< Zurück | Inhalt | Weiter >

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 Sphere objects within a cube, which ricochet off each other and the walls of the cube.