示例#1
0
        public void SplineDemoTest()
        {
            scene.Name = "TestSpline";

            var n = scene.Declare("myNumber", _N(0.5));
            var v = scene.Declare("myVector", _V(1, 0, 3));

            var spline = new PovSpline("MySpline")
            {
                SplineType = PovSpline.SplineTypeName.natural_spline
            }
            .Add(0, _V(0))
            .Add(n, v)
            .Add(1, _V(3, 0, 1));

            scene.Declare(spline);
            const int N = 50;

            for (int i = 0; i < N; i++)
            {
                var sphere = new Sphere()
                {
                    Center = spline[i * 1.0 / N],
                    Radius = 0.1
                }
                .AddModifiers(new Pigment(_RGB((i / (double)N + 1) / 2, 0, 0)));
                scene.Add(sphere);
            }
            var path = engine.Render(scene, options, false);
        }
示例#2
0
 public PovSplineTests()
 {
     n      = new PovNumber("n", 0.5);
     v      = new PovVector("v", 1, 2, 3);
     spline = new PovSpline("MySpline")
              .Add(0, new PovVector(0))
              .Add(n, v)
              .Add(1, new PovVector(3));
 }