Web site hosting - CHAPTER 16 Object interaction picking and collision detection 16.1
CHAPTER 16 Object interaction picking and collision detection 16.1 Introduction to picking 16.2 PickShapes 16.3 PickTool 16.4 PickCanvas 16.5 PickIntersection 16.6 PickResult 16.7 VRML picking example 16.8 Using picking for collision detection 16.9 Conclusions Two example applications of Java 3D s support for picking are presented here. The first example, in section 16.7, loads a VRML scene and reports the name of the object from the VRML scene that was picked when a mouse click occurs. The second example uses Java 3D s Bounds-based picking to implement simple collision detection. The example creates four Sphereobjects within a cube, which ricochet off each other and the walls of the cube. 16.1 Introduction to picking Picking is the act of identifying objects in the 3D scene, usually with a pointing device, such as the mouse. Java 3D s support for behaviors and picking can also be used to implement simple collision detection and response within a 3D scene. Picking is central to many of the direct-manipulation UI paradigms. Using direct manipulation, for example, you would translate an object by clicking it and moving the mouse, as opposed to typing the object ID and its new position into an edit field. For precision work, the edit field will work best; however, it abstracts the user from the 3D scene as compared to direct manipulation. Java 3D 1.2 includes some new classes that make picking relatively easy. These classes are a big improvement over the 1.1 picking classes, which have been widely deprecated. Before going into the details of the examples, I will describe the Java 3D 1.2 picking classes. The Java documentation for the picking classes is excellent, probably the best in Java 3D, so it is useful to familiarize yourself with it. 16.2 PickShapes java.lang.Object | 266
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.