Please Help,
I am very new at Java3D and trying to draw a solid polygon based on a set of Points (X, Y, and Z Coordinates). I was using JOGL but like the purely Object-oriented paradigm provided by Java3D. Anyway, I have a series of Points stored in a Vector and need to draw them as a Polygon that is solid. In JOGL I used the following code:
1 2 3 4 5 6 7
| Vector pts = getPoints(); gl.glBegin(GL.GL_POLYGON); for (int i = 0; i < pts.size(); i++) { PointData p = (PointData)pts.get(i); gl.glVertex3f(p.x, p.y, p.z); } gl.glEnd(); |
The problem is that when I have tried it with Java3D using the GeometryInfo Class I sometimes get strange triangulation renderings. Can anyone out there help a newbie out?
Thanks in advance.