POV-Ray : Newsgroups : povray.general : Real-time raytracing... : Re: Real-time raytracing... Server Time
7 Aug 2024 23:21:52 EDT (-0400)
  Re: Real-time raytracing...  
From: Thorsten Froehlich
Date: 3 Apr 2001 14:45:08
Message: <3aca1a34$1@news.povray.org>
In article <3ac9687d@news.povray.org> , "Nekar Xenos" 
<vir### [at] iconcoza> wrote:

> Can you post a sample? This sounds plausible, so it would be nice to see it
> work  =)

You have the sample code already.  Just look into the file povray.c in
the source distribution.  Follow it through once and call all the init
code.  Then just change the function FrameRender (povray.c) and merge it
with a modified version of function Start_Non_Adaptive_Tracing
(render.c) or call trace_pixel directly.  It is really easy and there is
not much work needed at all.  For example, take all the code and then
you should get an order like this:

 COLOUR col;

 ...
 init_vars();
 ...
 // build your scene here
 ...
 Initialize_xxx
 ...
 Initialize_Renderer();

 for(y...)
 {
  for(x...)
  {
   trace_pixel(x, y, col); // col contains the colour of the pixel
  }
 }

 Deinitialize_xxx
 ...

To find out how to construct objects manually, just take a look into the
Create_xxx (xxx = object name) methods in the individual source files.
For example, this creates a point light source:

 LIGHT_SOURCE *gLight;

 // light_source
 // {
 //  <-100, 80, -100>
 //  color rgb 1.2
 // }
 gLight = Create_Light_Source();
 Make_Vector(gLight->Center, -100.0, 80.0, -100.0);
 Make_Colour(gLight->Colour, 1.2, 1.2, 1.2);
 Post_Process((OBJECT *)gLight, NULL);
 Link_To_Frame((OBJECT *)gLight);

You can manipulate the light source easily by changing its center.

As for everything else, well, now you know how to get started - most of
the fun with POV-Ray is playing around with the source code :-)


      Thorsten


Post a reply to this message

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