< Zurück | Inhalt | Weiter >

2.2.1 A simple 3D projection routine

Here is my simple 3D−projection routine. The projectPoint method takes two Point3d instances, the first is the input 3D−coordinate while the second will be used to store the result of the projection from 3D to 2D coordinates (the z attribute will be 0). Point3d is one of the classes defined by Java 3D. Refer to the Java 3D JavaDoc for details. Essentially, it has three public members, x, y, and z that store the coordinates in the three axes.

 

From AwtRenderingEngine.java