Java3D Specific Hints

15. Don't be afraid to step outside Java3D

A conclusion from the 3 previous examples

The trap that many first-time developers is to do everything with the scene graph

Understand the limits of Java3D

The last three tips have all really been leading us in the same direction. The message is simple: don't be afraid to work outside Java3D. It is great for presenting results and the scene graph does impose a degree of structure on your application, but it doesn't diminsh the need for a good design. The trap that many first-time developers is to do everything with the scene graph and then attempt to build up the extra functionality as a bunch of different behaviours. But that's like designing the GUI before you know what your application does!

So the last tip is simply this: understand the limits of Java3D and if it can't do everything you want don't be afraid of building major parts of your application outside it's scope. Update the major state of your application in a separate thread, calculate your transformation matrices and perform your own collision detection and interface with the scene graph through a small number of Behaviour nodes.