Ejemplo n.º 1
0
 public void paint(OpenGL gl)
 {
     gl.Color(1f, 1f, 1f);
     gl.Begin(OpenGL.GL_TRIANGLE_STRIP);
         gl.Vertex(x, y + height, 0);
         gl.Vertex(x, y, 0);
         gl.Vertex(x+width, y + height, 0);
         gl.Vertex(x+width, y, 0);
     gl.End();
     gl.LineWidth(1);
     gl.Begin(OpenGL.GL_LINES);
     gl.Color(0, 0, 0);
         if (centerCoordinateX <= x + width && centerCoordinateX >= x)
         {
             gl.Vertex4d(centerCoordinateX, y, 0, 1);
             gl.Vertex4d(centerCoordinateX, y + height, 0, 1);
         }
         if (centerCoordinateY <= y + height && centerCoordinateY >= y)
         {
             gl.Vertex4d(x, centerCoordinateY, 0, 1);
             gl.Vertex4d(x+width, centerCoordinateY, 0, 1);
         }
     gl.End();
     for(int i = 0; i < functions.Count; i++)
     {
         drawFunction(gl, functions.ElementAt(i));
     }
 }
Ejemplo n.º 2
0
 void drawCircle(OpenGL gl, double radius, double y)
 {
     gl.Begin(OpenGL.GL_LINE_LOOP);
     for(int i = 0; i < 180; i++)
     {
         gl.Vertex4d(radius*Math.Cos(Math.PI/180*i*2), y, radius * Math.Sin(Math.PI / 180 * i*2), 1);
     }
     gl.End();
 }