private static void RenderStrip(Tesselator tess, HalfEdge halfEdge, int size) { /* Render as many CCW triangles as possible in a strip starting from * edge "e". The strip *should* contain exactly "size" triangles * (otherwise we've goofed up somewhere). */ tess.CallBegin(TriangleListType.TriangleStrip); tess.CallVertex(halfEdge.originVertex.ClientIndex); tess.CallVertex(halfEdge.directionVertex.ClientIndex); while (!halfEdge.leftFace.Marked()) { halfEdge.leftFace.marked = true; --size; halfEdge = halfEdge.Dprev; tess.CallVertex(halfEdge.originVertex.ClientIndex); if (halfEdge.leftFace.Marked()) { break; } halfEdge.leftFace.marked = true; --size; halfEdge = halfEdge.nextEdgeCCWAroundOrigin; tess.CallVertex(halfEdge.directionVertex.ClientIndex); } if (size != 0) { throw new Exception(); } tess.CallEnd(); }
static void RenderFan(Tesselator tess, HalfEdge e, int size) { /* Render as many CCW triangles as possible in a fan starting from * edge "e". The fan *should* contain exactly "size" triangles * (otherwise we've goofed up somewhere). */ tess.CallBegin(Tesselator.TriangleListType.TriangleFan); tess.CallVertex(e.originVertex.clientIndex); tess.CallVertex(e.directionVertex.clientIndex); while (!e.leftFace.Marked()) { e.leftFace.marked = true; --size; e = e.nextEdgeCCWAroundOrigin; tess.CallVertex(e.directionVertex.clientIndex); } if (size != 0) { throw new Exception(); } tess.CallEnd(); }
static void RenderStrip(Tesselator tess, HalfEdge halfEdge, int size) { /* Render as many CCW triangles as possible in a strip starting from * edge "e". The strip *should* contain exactly "size" triangles * (otherwise we've goofed up somewhere). */ tess.CallBegin(Tesselator.TriangleListType.TriangleStrip); tess.CallVertex(halfEdge.originVertex.clientIndex); tess.CallVertex(halfEdge.directionVertex.clientIndex); while (!halfEdge.leftFace.Marked()) { halfEdge.leftFace.marked = true; --size; halfEdge = halfEdge.Dprev; tess.CallVertex(halfEdge.originVertex.clientIndex); if (halfEdge.leftFace.Marked()) break; halfEdge.leftFace.marked = true; --size; halfEdge = halfEdge.nextEdgeCCWAroundOrigin; tess.CallVertex(halfEdge.directionVertex.clientIndex); } if (size != 0) { throw new Exception(); } tess.CallEnd(); }
static void RenderFan(Tesselator tess, HalfEdge e, int size) { /* Render as many CCW triangles as possible in a fan starting from * edge "e". The fan *should* contain exactly "size" triangles * (otherwise we've goofed up somewhere). */ tess.CallBegin(Tesselator.TriangleListType.TriangleFan); tess.CallVertex(e.originVertex.clientIndex); tess.CallVertex(e.directionVertex.clientIndex); while (!e.leftFace.Marked()) { e.leftFace.marked = true; --size; e = e.nextEdgeCCWAroundOrigin; tess.CallVertex(e.directionVertex.clientIndex); } if (size != 0) { throw new Exception(); } tess.CallEnd(); }