import javax.media.j3d.*; import javax.vecmath.*; public class Axes extends Shape3D { private static Color3f green = new Color3f(0,1,0); public Axes ( float sizeX, float sizeY, float sizeZ, Color3f colorX, Color3f colorY, Color3f colorZ) { Point3f zero = new Point3f(0,0,0); Point3f i = new Point3f(sizeX,0,0); Point3f j = new Point3f(0,sizeY,0); Point3f k = new Point3f(0,0,sizeZ); Color3f[] colors = { colorX, colorX, colorY, colorY, colorZ, colorZ }; Point3f[] vertices = { zero, i, zero, j, zero, k }; LineArray curve = new LineArray ( 6, LineArray.COORDINATES | LineArray.COLOR_3 ); curve.setCoordinates ( 0, vertices ); curve.setColors ( 0, colors ); this.setGeometry ( curve ); this.setAppearance ( null ); } public Axes ( float sizeX, float sizeY, float sizeZ ) { this ( sizeX, sizeY, sizeZ, green, green, green ); } }