Exemple #1
0
        public void Render(Curve3D curve, IXNAGame game, Color color)
        {
            float segmentLength = 0.1f;

            float start = curve.GetStart();
            float end   = curve.GetEnd();

            Vector3 lastPoint = curve.Evaluate(start);

            for (float i = start + segmentLength; i < end; i += segmentLength)
            {
                Vector3 newPoint = curve.Evaluate(i);
                game.LineManager3D.AddLine(lastPoint, newPoint, color);
                lastPoint = newPoint;
            }

            game.LineManager3D.AddLine(lastPoint, curve.Evaluate(end), color);
        }