The new .jar file. The coordinates are specified in the code as follows:
// Remember to
// draw the points in counter-clockwise order. That is the default
// way of determining which is the front of a polygon.
// o (1)
// / \
// / \
// (2) o-----o (0)
Shape3D shape = new Shape3D();
TriangleArray tri = new TriangleArray(3, TriangleArray.COORDINATES);
tri.setCoordinate(0, new Point3f(0.0f, 0.0f, 0.0f));
tri.setCoordinate(1, new Point3f(0.5f, 0.5f, 0.0f));
tri.setCoordinate(2, new Point3f(-0.5f, 0.5f, 0.0f));
The coordinate array takes inputs for x,y,z for each of 0,1,2. To invert, I moved 0 to the origin, 1 to .5,.5 and 2 to -.5,.5.
No comments:
Post a Comment