Once the volume has been loaded it may be necessary to change the orientation of the volume to match the application’s normal camera orientation or to be consistent with other geometry in the scene. For example if we loaded the sample volume “3DHead.ldm” instead of the “3DHead.vol”, the resulting image would look like this:
As usual we have the choice of rotating the geometry in the scene, using a transform node, or rotating the camera to a different orientation. Which choice is better depends on the application, in particular on the orientation of other geometry that may be needed in the scene. In both cases we will apply a rotation of pi radians (180 degrees) around the Z axis. The following (standard Open Inventor) code will rotate the geometry:
C++ :
C# :
Java :
The following code will rotate the camera:
C++ :
C# :
Java :
Resulting image:
Although the scaleFactor field of SoTransform can be used to resize the volume in 3D space, it is generally better to specify the 3D extent of the volume using the extent field of SoVolumeData.