Chapter 23. Shooting a GunThe application in this chapter, Shooter3D, contains a gun (actually a cone mounted on a cylinder) which fires a laser beam at the point on the checkered floor clicked on by the user. The flight of the laser beam (actually a red cylinder) is accompanied by a suitable sound, and followed by an explosion (an animated series of images and another sound).
There are three screenshots of Shooter3D on this page. The first one has
the laser beam in mid-flight, the second captures the explosion, and the
third is another explosion after the user has clicked on a different
part of the floor, from a different viewpoint.
Note how the cone head rotates to aim at the target point. Also, the animated explosion always faces the user's viewpoint.
Java 3D and Java features illustrated by this example: