|
|
In article <3d5bf720@news.povray.org>, Warp <war### [at] tagpovrayorg>
wrote:
> With the power or C++, you can get close to what POV-Ray SDL does. For
> example, you could have a vector class which is almost as flexible as in
> povray, like:
I know, I have constructed such a class for my raytracer and assumed one
for my example. Mine is just named "Vect3D" instead of "Vec", and for
this example it is called "vec".
> Camera cam(Vec(1,2,3), 0);
I was trying to make an equivalent to the original scene, which only
modifies the look_at and angle. A constructor with these didn't make
sense to me, so I did it with methods. My PerspectiveCamera would have
that constructor though, "PerspectiveCamera cam(vec(1,2,3), 0);" would
be perfectly valid.
> Box obj1(-1, 1)
> Sphere obj2(y, 1), obj3(x, .5);
> Difference csg1;
> csg1 << obj1 << obj2 << obj3;
> csg1.texture(Texture(Pigment(RGB(.5,1,1))));
>
> outfile << cam << l << csg1;
I don't see how this is significantly different from my example, except
you don't have a scene object to manage things and I wouldn't use the <<
operator to insert shapes into a CSG. I assumed a vector and color class
like you have, that's nothing different. There are some other
differences, in my version vlength() would be Vec::Length().
Aside from slightly different names, your code would work fine with my
framework. What "looks ugly" in my example that doesn't in yours?
--
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
|
|