Newbie: TriangleStipArray only rendering the lines
843799Mar 28 2003 — edited Apr 11 2003The function below as far as I can tell, is correclty setting up 6 vertices, in the correct order, and orientation (1 strip only). Yet it simply renders a line between each vertex (like LineArray), and never connects the last vertix with the previous 2. Am I missing something????? I even tried explicity creating an appearance, and polygon mode set to fill/cull_none
static public BranchGroup test()
{
int[] sl = new int[1];
sl[0] = 6;
LineStripArray lsa = new LineStripArray(6, LineArray.COORDINATES, sl);
Point3f[] pts = new Point3f[6];
pts[0] = new Point3f(0.0f, 1.0f, 0.0f);
pts[1] = new Point3f(0.0f, 0.0f, 0.0f);
pts[2] = new Point3f(1.0f, 1.0f, 0.0f);
pts[3] = new Point3f(1.0f, 0.0f, 0.0f);
pts[4] = new Point3f(2.0f, 1.0f, 0.0f);
pts[5] = new Point3f(2.0f, 0.0f, 0.0f);
//pts[6] = new Point3f(2.0f, 0.0f, 0.0f);
lsa.setCoordinates(0,pts);
Shape3D shape = new Shape3D();
shape.setGeometry(lsa);
// Should not need the appearance code..but even with it..
// it only renders the vertix line links.
Appearance app = new Appearance();
PolygonAttributes polyAtt = new PolygonAttributes();
polyAtt.setCullFace(PolygonAttributes.CULL_NONE);
polyAtt.setPolygonMode(PolygonAttributes.POLYGON_FILL);
app.setPolygonAttributes(polyAtt);
shape.setAppearance(app);
BranchGroup g = new BranchGroup();
g.addChild(shape);
return g;
}