Posts

Showing posts from October, 2016

4.2 What is a scenegraph | JAVA 3D Programming | Chapter 4

Image
4.2 What is a scenegraph? A scenegraph is a hierarchical data structure that captures the elements of spatial relationships between objects. Technically a scenegraph is a directed acyclic graph (DAG). Once you think and model an application hierarchically, the 3D graphics API is provided with a much richer set of information to use to optimize rendering. A scenegraph description also enables application developers to apply object−orientated (OO) principles such as abstraction and reuse to their designs. In Java 3D, the scenegraph is encapsulated within the Virtual Universe class. The scenegraph is composed of objects derived from the Node class. Every instance of the Node class has one parent Node. Additionally, the scenegraph contains objects derived from the Group class which encapsulates a collection of Node child objects. In this way a hierarchy of Group−derived objects can be created with Node−derived objects attached to the parent Group objects, as shown in figure 4.2....

4.1 Overview | JAVA 3D Programming | Chapter 4

Image
4.1 Overview Your application’s 3D virtual world contains geometric objects with which the user interacts. In Java 3D this virtual world is called the VirtualUniverse, the top−level class that contains all the elements that you define within your virtual world. In addition, the VirtualUniverse contains nongeometric objects that control or influence the world. Lights are a good example of this type of object. In a 3D environment, one cannot see a Light, but one can see the effect of the Light within its zone of influence. A concrete example helps to describe some of the details. Imagine a virtual world that models a Formula 1 Grand Prix race (figure 4.1). The model is a simplification of reality. It contains: • 3 Williams F1 cars • 2 Ferrari F1 cars • 3 McLaren F1 cars • 2 Jordan F1 cars • 1,000 trees 300 pine 300 oak 400 spruce • 100 pit crew 43 • 100 marshals • 60 advertising billboards 20 for a sport channel 20 for a car part manufacturer 20 fo...

3D Graphics Programming | Chapter 4

Image
CHAPTER 4 The scenegraph  4.1 Overview 39 4.2 What is a scenegraph? 4.3 Java 3D and the scenegraph 4.4 Elements of scenegraph design  4.5 Scenegraph advantages 4.6 Hierarchical control 4.7 Immediate mode vs. retained mode vs. mixed mode  4.8 Summary Is a scenegraph appropriate for your application? If you choose to use a scenegraph for your application you should be able to sketch the required elements out on paper.  In this chapter, I’ll introduce the concept of a scenegraph for modeling 3D scenes. I’ll present several examples that can be used to guide the scenegraph design process for your application. I’ll show you the benefits and drawbacks of using the Java 3D scenegraph along with comparative information for rendering in immediate mode and mixed mode. The possible elements of a Java 3D scenegraph are presented along with usage hints and tips.