POV-Ray : Newsgroups : povray.programming : I have some external OOP interface for povray. : Re: I have some external OOP interface for povray. Server Time
1 Jul 2024 03:23:49 EDT (-0400)
  Re: I have some external OOP interface for povray.  
From: Christopher James Huff
Date: 28 Apr 2004 15:22:49
Message: <cjameshuff-0F7939.15215028042004@news.povray.org>
In article <web.408fadc5786546717a2708b0@news.povray.org>,
 "Xoid" <xoid-at-yandex.ru> wrote:

> Look at http://povtoray.chat.ru/
> What would you say about it.?

As already mentioned, POV-Ray already has loops, conditionals, and 
variables. Here's a POV-only version of your scene:

camera {
    location < 1050, 950, -500>
    look_at <-300, 0, 1500>
}

#include "colors.inc"
#include "textures.inc"

global_settings {ambient_light rgb <4,4,4>}
// <4,4,4> as the global ambient?!? Don't you think that might be
//a little high?

light_source {< 2000, 2000, 2000>, color <50, 5, 5>}
//Again, rather insane color values.

//More oddball color values here...the components will reach values of 2.
//This is legal, but highly unrealistic.
#local X = 0;
#local Y = 0;
#local Z = 0;
#while(X < 1000)
    cylinder {< X, Y, 0>, < X, 1000 - Y, 1000 - Z>, 3
        pigment {color rgb < 1 + sin((X + Y)/500),
                            1 + sin(X/300),
                            1 + sin(Y/300)>}
    }
    #local X = X + 10;
    #local Y = Y + 10;
#end

#local Y = 0;
#local Z = 0;
#while(Y < 1000)
    cylinder {< 0, Y, Z>, < 1000, 1000 - Y, Z>, 3
        pigment {color rgb < 1 + sin(Y/300),
                            1 + sin(Z/300),
                            1 + sin((Y + Z)/300)>}
    }
    #local Y = Y + 10;
    #local Z = Z + 10;
#end


That's it...it's shorter, generally clearer, you don't have to mess 
around with allocating and deleting memory (though that is only a 
problem with the design of your C++ library...it could isolate the user 
from memory management), and you don't have to go through a 
compile-link-run cycle to render the image. (Though that isn't as much 
of a pain as it could be...my Lumini tracer is driven by C++, I use a 
script that builds the executable, runs it, and does whatever else is 
needed.)

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.