コード例 #1
0
        public void Draw()
        {
            GlobalMaterials.SetMaterial(MaterialType.AxisOrgin);
            IntPtr pObj          = NewQuadric();
            double _SphereRadius = 2.5;

            GL.Flush();
            GL.PushMatrix();
            GL.Translate(vec.X * scale, vec.Y * scale, vec.Z * scale);
            Sphere(pObj, _SphereRadius, 10, 10);
            GL.PopMatrix();
            pObj = IntPtr.Zero;
        }
コード例 #2
0
 public override void Draw2D()
 {
     GL.Enable(EnableCap.Lighting);
     GL.Enable(EnableCap.Blend);
     GL.Enable(EnableCap.DepthTest);
     GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
     GlobalMaterials.SetMaterial(MaterialType.ActiveBox);
     GL.Begin(PrimitiveType.LineStrip);
     GL.Vertex2(11, 11);
     GL.Vertex2(21, 11);
     GL.Vertex2(21, 0);
     GL.Vertex2(-11, 1);
     GL.End();
 }
コード例 #3
0
 /// <summary>
 /// 最终显示结果
 /// </summary>
 public override void Draw()
 {
     GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
     GlobalMaterials.SetMaterial(MaterialType.ActiveBox);
     for (int i = 0; i < nets.Count; i++)
     {
         Vector3 ori = nets[i].Item1 * 100,
                 tar = nets[i].Item2 * 100;
         DrawPoint(ori);
         DrawOneLine(ori, tar);
         DrawPoint(tar);
         Debug.WriteLine(ori.X.ToString() + "," + ori.Y.ToString() + "," +
                         ori.Z.ToString() + " " + tar.X.ToString() + "," + tar.Y.ToString() +
                         "," + tar.Z.ToString());
     }
 }
コード例 #4
0
 public TestShape()
 {
     material = new GlobalMaterials();
 }
コード例 #5
0
 public TestShape(GlobalMaterials material)
 {
     this.material = material;
 }