示例#1
0
        private void Redraw_Tick(object sender, EventArgs e)
        {
            GList = new List <Int32>();
            GList.Add(0);
            if (MostrarSolicita.Checked)
            {
                foreach (Dot dot in dots)
                {
                    GL.NewList(GList.Count, ListMode.Compile);
                    GL.PointSize(5);
                    GL.Begin(BeginMode.Points);
                    GL.Color3(dot.color);

                    decimal[] aux_dot = FactoryMatrix.xVxM(dot.matrix, dot.dot);
                    GL.Vertex3(Decimal.ToDouble(aux_dot[0]), Decimal.ToDouble(aux_dot[1]), Decimal.ToDouble(aux_dot[2]));

                    GL.End();
                    GL.EndList();
                    GList.Add(GList.Count);
                }
            }
            foreach (Line line in lines)
            {
                decimal[] from = FactoryMatrix.xVxM(line.matrix, line.from);
                decimal[] to   = FactoryMatrix.xVxM(line.matrix, line.to);

                GL.NewList(GList.Count, ListMode.Compile);
                GL.Begin(BeginMode.Lines);

                GL.LineWidth(line.width);
                GL.Color3(line.color);
                GL.Vertex3(Decimal.ToDouble(from[0]), Decimal.ToDouble(from[1]), Decimal.ToDouble(from[2]));
                GL.Vertex3(Decimal.ToDouble(to[0]), Decimal.ToDouble(to[1]), Decimal.ToDouble(to[2]));
                GL.End();
                GL.EndList();
                GList.Add(GList.Count);
            }

            Gl_Paint(gl, null);
        }