Exemplo n.º 1
0
        public void TestSphereWithPigment()
        {
            var sphere   = new Sphere();
            var whiteCol = new PovColor(1, 1, 1);
            var pigment  = new Pigment(whiteCol);

            sphere.AddModifiers(pigment);
            var povCode = sphere.ToPovCode();

            Check.That(povCode).IsEqualTo("sphere {\n < 0, 0, 0>, 1\n\npigment {\n color rgb < 1, 1, 1>\n}\n}");
        }
Exemplo n.º 2
0
        public void AddBlueSphere()
        {
            var sphere = new Sphere();

            sphere.AddModifiers(new Pigment()
            {
                Color = new PovColor(0, 0, 1)
            });
            scene.Declare("MySphere", sphere);
            scene.Add(sphere);
        }
Exemplo n.º 3
0
        public void SceneWithCommentTest()
        {
            PovComment comment1 = new PovComment()
            {
                Text = "Some comment"
            };
            PovComment comment2 = new PovComment()
            {
                Text = "Some comment again"
            };
            PovScene scene = new PovScene();

            scene.Add(comment1);
            scene.Add(new Camera()
            {
                Location = new PovVector(7), LookAt = new PovVector(0)
            });
            scene.Add(new Light());

            var sphere = new Sphere();

            sphere.AddModifiers(new Pigment()
            {
                Color = new PovColor(1)
            });
            scene.Declare("MySphere", sphere);
            scene.Add(comment2);
            scene.Add(sphere);
            string povCode = string.Join("\n", scene.ToPovCode());
            var    myScene = @"#include ""colors.inc""
/* Some comment */
camera {
 location < 7, 7, 7>
 look_at < 0, 0, 0>
}
light_source {
 < 5, 5, 5>, rgb < 1, 1, 1>
}
#declare MySphere = sphere {
 < 0, 0, 0>, 1

pigment {
 color rgb < 1, 1, 1>
}
};
/* Some comment again */
MySphere";

            Check.That(povCode).IsEqualTo(myScene.Replace("\r", string.Empty));
        }
Exemplo n.º 4
0
        public BasicDemoScene()
        {
            Add(new Camera()
            {
                Location = _V(7), LookAt = _V(0)
            });
            Add(new Light());

            var sphere = new Sphere();

            sphere.AddModifiers(new Pigment()
            {
                Color = new PovColor(1)
            });
            Declare("MySphere", sphere);
            Add(sphere);
        }
Exemplo n.º 5
0
        public void TestScene1()
        {
            PovScene scene = new PovScene();

            scene.Add(new Camera()
            {
                Location = new PovVector(7), LookAt = new PovVector(0)
            });
            scene.Add(new Light());

            var sphere = new Sphere();

            sphere.AddModifiers(new Pigment()
            {
                Color = new PovColor(1)
            });
            scene.Declare("MySphere", sphere);
            scene.Add(sphere);
            string povCode = string.Join("\n", scene.ToPovCode());

            Check.That(povCode).IsEqualTo(myScene);
        }