»
This is one of the Advanced Learning Examples included with Phrogram. It renders a 3D arrow among a random field of 3D spheres. The program uses a 3D distance calculation to identify the sphere nearest to the arrow, then rotates the arrow to point at the sphere, moves it forward until the arrow "pops" the sphere, then the program looks for the next closest arrow. All this is extremely useful and reusable code for others writing their own 3D games.