< Zurück | Inhalt | Weiter >

obj = new QuadArray(totalVerts, QuadArray.COORDINATES);

}


Point3f[] newpts = new Point3f[totalVerts]; Vector3f[] newnormals = new Vector3f[totalVerts]; Point2f[] newtcoords = new Point2f[totalVerts]; int currVert = 0;


for (i = 0; i < currPrimCnt; i++)

{

for (int j = currPrimStartVertex[i] + 2; j < currPrimEndVertex[i];j+=2)

{

outVertex(newpts, newnormals, newtcoords, currVert++, pts, normals, tcoords, j − 2);

outVertex(newpts, newnormals, newtcoords, currVert++, pts, normals, tcoords, j − 1);

outVertex(newpts, newnormals, newtcoords, currVert++, pts, normals, tcoords, j + 1);

outVertex(newpts, newnormals, newtcoords, currVert++, pts, normals, tcoords, j);

numTris += 2;

}

}

numVerts = currVert;


obj.setCoordinates(0, newpts);

if ((flags GENERATE_NORMALS) != 0)

obj.setNormals(0, newnormals);

if ((flags GENERATE_TEXTURE_COORDS) != 0)

obj.setTextureCoordinates(0, newtcoords); geometry = obj;

return obj;

}


image