The Universal 3D (U3D) format is a 3D format which has been developed by the 3D Industry Forum (3dIF). U3D has gained widespread adoption within the Engineering community. It is one of the formats that supports 3D within PDF. The U3D HIO component introduces support for import and export of U3D within the HOOPS.
To use this integration, you must install the SDK included in the Universal 3D Sample Software which is distributed under an Apache style license at sourceforge.org. As of writing, the U3D toolkit was not provided with pre-built binaries for Visual Studio 2005 and so you may need to build the U3D toolkit before you can proceed any further. Once you have a Visual Studio 2005 U3D libraries built, please follow the steps below to use the HOOPS/HIO component:
During start-up, when HOOPS/MVO finds the U3D HIO component in your application's path, it will perform the following steps:
Once the U3D HIO component is successfully loaded, your application will be able import and export U3D files without having to recompile HOOPS. To utilize the extensive services available in the U3D SDK, you must compile against the U3D libraries directly and follow the steps described in 2.0 Integrating Directly with U3D.
To export to a 3D PDF, you must set the HOutputHandlerOptions::m_b3dOutput flag to true when using the HBaseModel::WriteWithOptions method. You will also need to define the camera settings so they can be saved with the model. To do this, specify the desired camera settings in your instance of HBaseView. Then supply a pointer to your HBaseView object via HOutputHandlerOptions::m_pHBaseView in your call to the HBaseModel::WriteWithOptions method.
The U3D HIO component was built against a specific version of the U3D toolkit. If you want your application to run against another version of the U3D SDK, we recommend that you rebuild the U3D HIO component with that version of the library. To do so, simply open the hio_u3d_vc<version>.vcproj project located in the <hoops>/Dev_Tools/hoops_hio/hio_u3d/source. Be sure to set the environment variable U3D_SDK_DIR to point to the root of your U3D installation before you begin building. Once the project is built against the correct libraries, an .hio file will be created. Note that you may have some obstacle building against a different version of the U3D if interfaces are not compatible with the original libraries that the HIO component was built against.
In this section, we will outline the steps involved in integrating your HOOPS-based application directly with the U3D libraries. First, you must install the SDK included in the Universal 3D Sample Software which is distributed under an Apache style license at sourceforge.org. You may be required to build the U3D libraries if pre-built binaries are not provided in the package. Once all the binaries are installed in your path, please follow the step below:
Once you have completed the above steps, you do not need to rely on the U3D HIO component anymore. Please remove the associated .hio file from the hio_plugins directory in your application's working directory. Note that in a direct integration, you must register HIOUtilityU3D as an input and output handler with the HIOManager so that the HBaseModel read/write functions can recognize that the U3d file format is supported. For more information on HOOPS/MVO file input/output architecture, please see section 4.0 File Input/Output and the I/O Manager of the HOOPS/MVO Programming Guide.
You should be able to import or export U3D files from your application with code similar to this:
HIOUtilityU3D *handler; // This is the code for reading a U3D file char *inputfile = "c:\\temp\\myInput.u3d"; HFileInputResult result = handler->FileInputByKey(inputfile, m_pHView->GetModelKey(), NULL); // While this code could be used to write a U3D file char *outputfile = "c:\\temp\\myOutput.u3d"; HOutputHandlerOptions options; options.m_pHBaseView = m_pHView; HFileOutputResult result = handler->FileOutputByKey(outputfile, m_pHView->GetModelKey(), &options);
The U3D toolkit demonstrate extremely poor performance when creating polyline geometry. So, in our current implementation, we do not export any line data into the file. Also, U3D has extremely basic 3D definitions. Thus, some of the more advanced HOOPS/3dGS geometry and attributes may not be represented within our U3D export. Examples include text as well as some of the more sophisticated color interpolation schemes and static 2D geometry within a 3D scene. Animations composed of rotation, translation, scaling and camera movements are supported. However, the more advanced animations found in HOOPS/MVO like segment switches, vertex morphing, color morphing and attribute switches cannot be exported to U3D.
Our integration is only supported on Microsoft Visual Studio 2005. However, since the U3D toolkit is provided in source code form, developers should be able to port the integration on unsupported platforms.
In Release 17, the U3D HIO component requires version 1.2.851.0 of the U3D toolkit .