ViewingPlatform setNominalViewingTransform() Method
Package: com.sun.j3d.utils.universe
The ViewingPlatform class is used to set up the view branch graph of a Java 3D scene graph in a
SimpleUniverse object. This method is normally used in conjunction with the getViewingPlatform
method of the SimpleUniverse class.
void setNominalViewingTransform()
Sets the nominal viewing distance to approximately 2.41 meters in the view transform of a
SimpleUniverse. At this viewing distance and the default field of view, objects of height and width of 2
meters generally fit on the image plate.
After creating Canvas3D and Simple Universe objects, the next step is the creation of the content branch
graph. The regularity of structure found in the view branch graph (that leads to using the SimpleUniverse
class) does not exist for the content branch graph. The content branch graph varies from program to
program making it impossible to give details for construction in a recipe. It also means that there is no
“simple content” class for any universe you may want to assemble.
Creating a content branch graph is the subject of Sections 1.6, 1.7, and 1.9. Compiling the content
branch graph is discussed in Section 1.8. If you cannot wait to see some code, see Code Fragment 1-1 for
an example of using the SimpleUniverse class.
After creating the content branch graph, it is inserted into the universe using the addBranchGraph method
of SimpleUniverse. The addBranchGraph method takes an instance of BranchGroup as the only
parameter. This BranchGroup is added as a child of the Locale object created by the SimpleUniverse.
SimpleUniverse Methods (partial list)
Package: com.sun.j3d.utils.universe
void addBranchGraph(BranchGroup bg)
Used to add Nodes to the Locale object of the scene graph created by the SimpleUniverse. This is used
to add a content branch graph to the virtual universe.
ViewingPlatform getViewingPlatform()
Used to retrieve the ViewingPlatform object the SimpleUniverse instantiated. This method is used with
the setNominalViewingTransform() method of ViewingPlatform to adjust the location of the view
position