示例#1
0
        public void Draw(Matrix4d transformacja, int size = 4, double red = 1, double green = 1, double blue = 1)
        {
            //Matrix4d projekcja = MatrixProvider.ProjectionMatrix(100);
            GL.Enable(EnableCap.VertexProgramPointSize);
            GL.PointSize(size);
            GL.Begin(BeginMode.Points);


            if (_selected)
            {
                GL.Color3(0.0, 1.0, 0.0);
            }
            else
            {
                GL.Color3(red, green, blue);
            }

            Matrix4d projection = MatrixProvider.ProjectionMatrix();

            _windowCoordinates = projection.Multiply(transformacja.Multiply(_coordinates));
            GL.Vertex2(_windowCoordinates.X, _windowCoordinates.Y);
            _windowCoordinates.X = _windowCoordinates.X * 1440 / 2;
            _windowCoordinates.Y = _windowCoordinates.Y * 750 / 2;

            GL.End();
        }
示例#2
0
        public void DrawVectors(Matrix4d transformacja)
        {
            if (VectorsVisibility)
            {
                GL.Begin(BeginMode.Lines);
                GL.Color3(1.0, 1.0, 0);
                foreach (var item in ControlArrayC1)
                {
                    for (int i = 1; i < 6; i++)
                    {
                        Matrix4d projection = MatrixProvider.ProjectionMatrix();
                        var      a          = projection.Multiply(transformacja.Multiply(item[0][i]));
                        var      b          = projection.Multiply(transformacja.Multiply(item[1][i]));
                        var      c          = projection.Multiply(transformacja.Multiply(2 * item[0][i] - item[1][i]));

                        //GL.Vertex2(new Vector2d(a.X / 720, a.Y / 375));
                        //GL.Vertex2(new Vector2d(b.X / 720, b.Y / 375));
                        //GL.Vertex2(new Vector2d((2*(item[0][i].X_Window / (1440.0 / 2.0) )- item[1][i].X_Window /(1440.0 / 2.0)), (2* (item[0][i].Y_Window / (1440.0 / 2.0) )- item[1][i].Y_Window / (1440.0 / 2.0))));
                        //GL.Vertex2(new Vector2d(item[1][i].X_Window/ (1440.0 / 2.0) , item[1][i].Y_Window/(750.0 / 2.0)));
                        GL.Vertex2(new Vector2d(c.X, c.Y));
                        GL.Vertex2(new Vector2d(b.X, b.Y));
                    }
                }

                GL.End();
            }
        }
示例#3
0
        public Cursor()
        {
            _coordinates      = new Vector4d(0, 0, 0, 1);
            _windowCoordinate = new Vector4d(0, 0, 0, 1);
            CreateVertices();

            _projection      = MatrixProvider.ProjectionMatrix();
            _projectionLeft  = MatrixProvider.LeftProjectionMatrix();
            _projectionRight = MatrixProvider.RightProjectionMatrix();
        }
示例#4
0
        public void Draw(Matrix4d transformacja)
        {
            Matrix4d projekcja = MatrixProvider.ProjectionMatrix();

            GL.Begin(BeginMode.Lines);
            GL.Color3(1.0, 1.0, 1.0);

            foreach (var relations in _relationsList)
            {
                var vertex  = transformacja.Multiply(_verticesList[relations.Item1]);
                var vertex2 = transformacja.Multiply(_verticesList[relations.Item2]);
                GL.Vertex2(projekcja.Multiply(vertex).X, projekcja.Multiply(vertex).Y);
                GL.Vertex2(projekcja.Multiply(vertex2).X, projekcja.Multiply(vertex2).Y);
                //}
                //GL.Vertex3(_verticesList[relations.Item1]);
                //GL.Vertex3(_verticesList[relations.Item2]);
            }
            GL.End();
        }