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:27:41 EDT (-0400)
  Re: I have some external OOP interface for povray.  
From: Warp
Date: 28 Apr 2004 09:48:45
Message: <408fb63d@news.povray.org>
Xoid <xoid-at-yandex.ru> wrote:
> Look at http://povtoray.chat.ru/
> What would you say about it.?

  Why do you do it in such needlessly complicated way?
  The example in the page could perfectly be implemented like this (with
the proper modifications to the library):

#include "povtor.hh" // This is not a C header. Don't name it as if it was.

int main()
{
    Frame frame("c:\\my\\sedlo.pov");

    Camera cam(1050, 950, -500, -300, 0, 1500);
    Light light(2000, 2000, 2000, 50, 5, 5);

    frame << "#include \"colors.inc\"\n#include \"textures.inc\"\n\n"
          << "global_settings {ambient_light rgb<4,4,4>}\n\n"
          << cam << light;

    Cylinder cyl(3); // Could have this kind of constructor to set the radius
                     // If it's odd, you could just do cyl.Radius(3) instead

    for(int x = 0, y = 0; x < 1000; x += 10, y += 10)
    {
	cyl.SetEnds(x,y,0, x,1000-y,1000);
        cyl.Texture.Color(1+sin((x+y)/500), 1+sin(x/300), 1+sin(y/300));
	frame << cyl;
    }

    for(int y = 0, z = 0; y < 1000; y += 10, z += 10)
    {
	cyl.SetEnds(0,y,z, 1000,1000-y,z);
        cyl.Texture.Color(1+sin(y/300), 1+sin(z/300), 1+sin(y+z/400));
	frame << cyl;
    }

    frame.Render();

    return 0;
}

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

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