static void Main(string[] args) { PovScene scene = new PovScene() { Name = "Droid" }; PovEngine engine = new PovEngine(@"c:\Program Files\POV-Ray\v3.7\bin\pvengine64.exe", @"e:\tmp"); PovEngineOptions options = new PovEngineOptions() { Height = 480, Width = 640, PreviewStartSize = 32, PreviewEndSize = 16, PauseWhenDone = true }; var mainPigment = new Pigment(_White); var decoPigmentMinor = new Pigment(_Gray20); var decoPigmentMajor = new Pigment(_Orange); var droid = new DroidObject(mainPigment, decoPigmentMajor, decoPigmentMinor); droid.AddModifiers(new Pigment(new PovColor(1, 0, 0))); scene.Add( new Camera() { Location = _V(0, 1.5, 4), LookAt = new PovVector(0, 1, 0) }, new Light(), new Plane().AddModifiers(new Pigment(_Green)) ); scene.Add(droid); var(path, process) = engine.Render(scene, options); process.WaitForExit(); Process.Start(@"C:\Program Files (x86)\XnView\xnview.exe", @"e:\tmp\droid.png"); }
public AbstractPovEngineTests() { scene = new PovScene(); scene.Add(element: new Camera() { Location = new PovVector(7), LookAt = new PovVector(0) }); scene.Add(new Light()); }
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)); }
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); }