Exemple #1
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);
            GL.Clear(ClearBufferMask.ColorBufferBit);
            GL.MatrixMode(MatrixMode.Modelview);
            GL.LoadIdentity();

            //Eixo X
            GL.Color3(Color.Red);
            GL.LineWidth(3);
            GL.Begin(PrimitiveType.Lines);
            GL.Vertex2(0, 0);
            GL.Vertex2(150, 0);
            GL.End();

            //Eixo Y
            GL.Color3(Color.Green);
            GL.Begin(PrimitiveType.Lines);
            GL.Vertex2(0, 0);
            GL.Vertex2(0, 150);
            GL.End();

            //Sr. palito
            SegReta.dynamicLine(this.ponto4DBase, Color.Black, this.size, this.rotationGrados);

            this.SwapBuffers();
        }
Exemple #2
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);
            GL.Clear(ClearBufferMask.ColorBufferBit);
            GL.MatrixMode(MatrixMode.Modelview);
            GL.LoadIdentity();

            //Eixo X
            GL.Color3(Color.Red);
            GL.LineWidth(3);
            GL.Begin(PrimitiveType.Lines);
            GL.Vertex2(0, 0);
            GL.Vertex2(200, 0);
            GL.End();

            //Eixo Y
            GL.Color3(Color.Green);
            GL.Begin(PrimitiveType.Lines);
            GL.Vertex2(0, 0);
            GL.Vertex2(0, 200);
            GL.End();

            //Circulos
            Ponto4D center1 = new Ponto4D();

            center1.X = 0;
            center1.Y = 100;
            Circulo.drawCircle(Color.Black, 5, 5, 100, center1);

            Ponto4D center2 = new Ponto4D();

            center2.X = 100;
            center2.Y = -100;
            Circulo.drawCircle(Color.Black, 5, 5, 100, center2);

            Ponto4D center3 = new Ponto4D();

            center3.X = -100;
            center3.Y = -100;
            Circulo.drawCircle(Color.Black, 5, 5, 100, center3);



            //Triângulo
            Ponto4D ponto1 = new Ponto4D();

            ponto1.X = 0;
            ponto1.Y = 100;

            Ponto4D ponto2 = new Ponto4D();

            ponto2.X = 100;
            ponto2.Y = -100;
            Ponto4D ponto3 = new Ponto4D();

            ponto3.X = -100;
            ponto3.Y = -100;
            SegReta.drawTriangle(ponto1, ponto2, ponto3, Color.Aqua, PrimitiveType.Lines);

            this.SwapBuffers();
        }