示例#1
0
        public void Draw(VideoDriver driver)
        {
            driver.SetTransform(TransformationState.World, Matrix.Identity);

            // set material
            Material m = Material.IdentityNoLighting;

            m.Wireframe       = true;
            m.BackfaceCulling = false;
            m.Type            = MaterialType.TransparentVertexAlpha;
            m.ZWrite          = false;

            // draw back lines
            m.ZBuffer = ComparisonFunc.Greater;
            driver.SetMaterial(m);
            driver.DrawVertexPrimitiveList(vertBack, indBoth, PrimitiveType.Lines);

            // draw front lines
            m.ZBuffer = ComparisonFunc.LessEqual;
            driver.SetMaterial(m);
            driver.DrawVertexPrimitiveList(vertFront, indBoth, PrimitiveType.Lines);

            // draw front points
            m.Thickness = 10;
            driver.SetMaterial(m);
            driver.DrawVertexPrimitiveList(vertFront, indBoth, PrimitiveType.Points);
        }
示例#2
0
        void CSampleSceneNode_OnRender()
        {
            ushort[]    indices = new ushort[] { 0, 2, 3, 2, 1, 3, 1, 0, 3, 2, 0, 1 };
            VideoDriver driver  = SceneManager.VideoDriver;

            driver.SetMaterial(material);
            driver.SetTransform(TransformationState.World, AbsoluteTransformation);
            driver.DrawVertexPrimitiveList(vertices, indices);
        }
示例#3
0
		public void Draw(VideoDriver driver)
		{
			driver.SetTransform(TransformationState.World, Matrix.Identity);

			// set material
			Material m = Material.IdentityNoLighting;
			m.Wireframe = true;
			m.BackfaceCulling = false;
			m.Type = MaterialType.TransparentVertexAlpha;
			m.ZWrite = false;

			// draw back lines
			m.ZBuffer = ComparisonFunc.Greater;
			driver.SetMaterial(m);
			driver.DrawVertexPrimitiveList(vertBack, indBoth, PrimitiveType.Lines);

			// draw front lines
			m.ZBuffer = ComparisonFunc.LessEqual;
			driver.SetMaterial(m);
			driver.DrawVertexPrimitiveList(vertFront, indBoth, PrimitiveType.Lines);

			// draw front points
			m.Thickness = 10;
			driver.SetMaterial(m);
			driver.DrawVertexPrimitiveList(vertFront, indBoth, PrimitiveType.Points);
		}