Пример #1
0
 public static void DrawGeometry(Geometry geometry, Camera camera)
 {
     using GeometryElements polygonGroup = new GeometryElements(1, geometry.GeometryData, geometry.RenderOptions);
     polygonGroup.Add(geometry);
     polygonGroup.ApplyChanges();
     polygonGroup.Draw(camera);
 }
Пример #2
0
        public static void DrawTriangle(Vector3 a, Vector3 b, Vector3 c, Color color, Camera camera)
        {
            GeometryData  temp          = new GeometryData(new Mesh(new Vector3[] { a, b, c }, new short[] { 0, 1, 2 }));
            RenderOptions renderOptions = new RenderOptions(); //{ RasterizerState = RasterizerState.CullNone };

            using GeometryElements geometryGroup = new GeometryElements(1, temp, renderOptions);
            geometryGroup.Add(new Polygon()
            {
                GeometryData = temp, RenderOptions = renderOptions, Tint = color
            });
            geometryGroup.ApplyChanges();
            geometryGroup.Draw(camera);
        }