This Java applet illustrates a three-dimensional graphics example: a rotating
wireframe cube. Four classes are necessary. Here is the source code for each.
xyzpoint.java: to represent a point in three
dimensional space
xyzline.java:
to represent a line connecting two points in three dimensional space
wirefr.java:
to represent a wireframe object as an array of xyzline objects
cube.java:
to display a rotating wireframe cube
(adapted from Java Programming
the Easy Way, Douglas Downing, Barron's Educational Series)
Back to the Dictionary of Computer and Internet Terms
Programs page