Пример #1
0
        public LineListCommand3D(Vector3[] points, Color color, float thickness) :
            base(color)
        {
            this.Points = points;
            Matrix worldMatrix = Matrix.Identity;
            List <VertexPositionColor> vertices = Drawer3D.GetTriangleStrip(points, thickness, color, ref triangleCount, worldMatrix);

            triangles = new VertexPositionColor[vertices.Count];
            vertices.CopyTo(triangles);
        }
Пример #2
0
        public BoxDrawCommand3D(BoundingBox box, Color color, float thickness, bool warp) :
            base(color)
        {
            BoundingBox = box;
            Matrix worldMatrix = Matrix.CreateScale(box.Max.X - box.Min.X, box.Max.Y - box.Min.Y, box.Max.Z - box.Min.Z);

            worldMatrix.Translation = box.Min;

            for (int i = 0; i < 4; i++)
            {
                Vector3[] points = warp ? VertexNoise.WarpPoints(BoxPoints[i], new Vector3(box.Max.X - box.Min.X, box.Max.Y - box.Min.Y, box.Max.Z - box.Min.Z), box.Min) : BoxPoints[i];

                int count = 0;

                List <VertexPositionColor> triangleStrip = Drawer3D.GetTriangleStrip(points, thickness, color, ref count, worldMatrix);
                _stripVertices.Add(new VertexPositionColor[triangleStrip.Count]);
                _stripTriangleCounts.Add(count);
                triangleStrip.CopyTo(_stripVertices[i]);
            }
        }