Ejemplo n.º 1
0
        public BlobSceneTests()
        {
            var blob = new Blob();

            blob.AddModifiers(new Pigment()
            {
                Color = new PovColor(0, 0, 1)
            });
            scene.Add(blob);
            blob.AddSphere(_X, 1, 2);
            blob.AddSphere(_Y, 1, 2);
            blob.AddSphere(_Z, 1, 2);
        }
Ejemplo n.º 2
0
        public void TestToPovCode()
        {
            var blob = new Blob("myBlob")
            {
                Threshold = 1, Sturm = true, Hierarchy = false
            };

            blob.AddSphere(new PovVector(1, 0, 0), 1, 2);
            blob.AddCylinder(new PovVector(1, 0, 0), new PovVector(0, 1, 0), 1, 2);
            var povCode = blob.ToPovCode();

            Check.That(povCode).IsEqualTo("blob {\n threshold 1\n sphere {\n < 1, 0, 0>, 1, strength 2}\ncylinder {\n < 1, 0, 0>, < 0, 1, 0>, 1, strength 2}\n}");
        }
Ejemplo n.º 3
0
        public void TestToPovCodeWithName()
        {
            var center1   = new PovVector("c1", 1, 1, 1);
            var center2   = new PovVector("c2", -1, -1, -1);
            var threshold = new PovNumber("MyThreshold", 1);
            var strength  = new PovNumber("MyStrength", 2);
            var blob      = new Blob("myBlob")
            {
                Threshold = threshold
            };

            blob.AddSphere(center1, 1, strength);
            blob.AddCylinder(center2, new PovVector(0, 1, 0), 1, 2);
            var povCode = blob.ToPovCode();

            Check.That(povCode).IsEqualTo("blob {\n threshold MyThreshold\n sphere {\n c1, 1, strength MyStrength}\ncylinder {\n c2, < 0, 1, 0>, 1, strength 2}\n}");
        }