4.4 Elements of scenegraph design | JAVA 3D Programming | Chapter 4
Designing a good scenegraph structure
may involve making trade−offs across several factors. The scenegraph should be
easy to manipulate at runtime (you may want to dynamically attach and detach
entire branches to switch them on or off) as well as easy to customize in the
future. You may have to make compromises to get good performance to ensure that
Java 3D can process your scenegraph efficiently.
Object−oriented
Object
orientation allows easy reuse of scenegraph branches. Ideally, each branch
should define a component of the application that can be meaningfully used
independently of the other scenegraph branches. You should imagine having to
drop the scenegraph branch in question into another application.
Compilable
Level of detail independent
A
scenegraph branch should be able to have new child Nodes added to introduce new
complexity into the scene, without disrupting other scenegraph branches.
Polymorphic (customizable)
By
replacing child elements of a parent Group, you should be able to create new
but related scenegraph branches.
Bounds and level of detail aware
Objects
with large bounding volumes tend to imply “often visible” which generally
implies “performance critical.” Do not make objects that are often visible
(such as the trees in the Trees Group) of such high level of detail that they
negatively impact application performance. Using high−detail models for the F1
cars themselves may be less critical as they have smaller Bounds and hence
fewer of them are visible for most of the time. How you choose to apportion the
detail within your scene will always be application/domain−specific or only
domain specific, and may be related to the Bounds information of your
scenegraph Nodes.
Comments
Post a Comment