public override void gengldata() { gldata = new glList[1]; // we need only one display-list for representing a Line gldata[0].type = glType.GL_LINES; gldata[0].Points = new Point[2]; // we need two points for a line gldata[0].Points[0] = start; gldata[0].Points[1] = end; gldata[0].shown = true; gldata[0].color.r = color.R; gldata[0].color.g = color.G; gldata[0].color.b = color.B; gldata[0].dlistID = 0; }
public override void gengldata() { gldata = new glList[1]; // we only need one glList for drawing a point gldata[0].type = glType.GL_POINTS; gldata[0].Points = new Point[1]; // we only need one point gldata[0].Points[0].x = p.x; gldata[0].Points[0].y = p.y; gldata[0].Points[0].z = p.z; gldata[0].color.r = color.R; gldata[0].color.g = color.G; gldata[0].color.b = color.B; gldata[0].shown = true; gldata[0].dlistID = 0; }
public override void gengldata() { gldata = new glList[1]; // we need only one display-list for representing an STLSurf gldata[0].type = glType.GL_TRIANGLES; gldata[0].Points = new Point[tris.Count * 3]; // loop thorugh triangles and add points to gllist int n = 0; foreach (Tri t in tris) { gldata[0].Points[n] = new Point(t.p[0].x, t.p[0].y, t.p[0].z); gldata[0].Points[n + 1] = new Point(t.p[1].x, t.p[1].y, t.p[1].z); gldata[0].Points[n + 2] = new Point(t.p[2].x, t.p[2].y, t.p[2].z); n += 3; } gldata[0].color.r = 11; gldata[0].color.g = 22; gldata[0].color.b = 33; gldata[0].shown = true; gldata[0].dlistID = 0; }