Exemplo n.º 1
0
        static void Main()
        {
            CurrentProcess = Process.GetCurrentProcess();

            Option option = OptionFactory.CreateOption();

            RenderContext = new PotatoRenderContext(option);
            RenderContext.Scene.LoadRandomScene();

            Console.WriteLine("--- Potato Raytracing ---");
            Console.WriteLine("Scene parameters:");
            Console.WriteLine(RenderContext.Scene.ToString());
            Console.WriteLine();
            Console.WriteLine("Configurations:");
            Console.WriteLine(RenderContext.Scene.GetOptions().ToString());

            Console.Write("Press to continue any key to beggin.");
            Console.ReadLine();

            RenderContext.MakeImage("potatoImage.bmp");
            //RenderContext.MakeVideo("potatoVideo.avi");

            Console.WriteLine("Render time: {0} seconds", RenderContext.GetRenderTime / Constants.MILLIS);
            Console.WriteLine("Render time: {0} ms", RenderContext.GetRenderTime);

            Console.Write("Press to continue any key to exit.");
            Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            CurrentProcess = Process.GetCurrentProcess();

            Option option = OptionFactory.CreateOption();

            RenderContext = new PotatoRenderContext(option);

            Console.WriteLine("--- Potato Raytracing ---");
            Console.WriteLine("Configurations:");
            Console.WriteLine(RenderContext.GetScene().GetOptions().ToString());

            Console.Write("Press to continue any key to beggin.");
            Console.ReadLine();

            double timeStart = CurrentProcess.UserProcessorTime.TotalMilliseconds;

            RenderContext.Start("potatoImage.bmp");

            Console.WriteLine("Render time: {0} s", (CurrentProcess.UserProcessorTime.TotalMilliseconds - timeStart) % 60000 / 1000);

            Console.Write("Press to continue any key to exit.");
            Console.ReadLine();
        }