Skip to Main Content
Killer Game Programming in Java
book

Killer Game Programming in Java

by Andrew Davison
May 2005
Intermediate to advanced content levelIntermediate to advanced
998 pages
26h
English
O'Reilly Media, Inc.
Content preview from Killer Game Programming in Java

Other Java 3D Approaches

The particle systems in this chapter were coded with BY_REFERENCE geometries and GeometryUpdater, but what other ways are there of writing particle systems?

One possibility is to represent each particle by a separate TransformGroup and Shape3D pair and have the particle system move the shapes by adjusting the TransformGroups. This coding style is utilized in an example by Peter Palombi and Chris Buckalew, which is part of Buckalew's CSc 474 Computer Graphics course (http://www.csc.calpoly.edu/~buckalew/474Lab5-W03.html). It has the advantage of being simple to understand but isn't scaleable to large numbers of particles.

Another technique is to store all the particles in a GeometryArray as before, but do the updates directly without the involvement of a GeometryUpdater. Synchronization problems can be avoided by detaching the Shape3D from the scene graph before the updates are made and reattaching it afterward. The detachment of the shape removes it from the rendering cycle, so synchronization problems disappear. There seems little advantage to this approach since the overhead of removing and restoring scene graph nodes is large.

If the application uses mixed mode or immediate mode rendering, then the programmer gains control of when rendering is carried out and can avoid synchronization problems.

The excellent Yaarq demo by Wolfgang Kienreich (downloadable from http://www.ascendancy.at/downloads/yaarq.zip) is a mixed mode Java3D example showing off a range ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Game Development with LibGDX: From Beginner to Professional

Java Game Development with LibGDX: From Beginner to Professional

Lee Stemkoski

Publisher Resources

ISBN: 0596007302Supplemental ContentErrata Page