4.2.3. Advanced solution

The action SoToU3DAction SoToU3DAction SoToU3DAction generates an intermediate U3D format file. Advanced PDF editors, for example Acrobat3D from Adobe, can load these files in order to produce more complex 3D PDF documents.

The SoToU3DAction SoToU3DAction SoToU3DAction and the SoToPDFAction SoToPDFAction SoToPDFAction operate in the same manner. For example:

Example 4.7. Generation of U3D output

  SoSeparator* root = ...        // scenegraph init
  SoToU3DAction u3dAction;
  bool result = u3dAction.openFile( "output.u3d" );
  if ( !result ) ...             // error management
  u3dAction.apply( root );
  result = u3dAction.closeFile();
  if ( !result ) ...             // error management