POV-Ray : Newsgroups : povray.programming : Source Code again ! : Re: Source Code again ! Server Time
28 Jul 2024 14:24:34 EDT (-0400)
  Re: Source Code again !  
From: Thomas Willhalm
Date: 29 Aug 2000 08:17:15
Message: <qqm66okz2gk.fsf@schlatt.fmi.uni-konstanz.de>
"Mathias" <Mat### [at] dlrde> writes:

> I have to find out how POV Ray calculate a ray. E.G. If i have a box or an
> other object and i give them a light source: How can i find out what parts
> of the C-Files are in use to calculate this process ? How reflect the
> program this ray ? If u have any ideas how to start this difficult task

The routine that calculates the intersection of a box and a ray is 
Intersect_Box in boxes.c. For most POV objects there exists a c file that
contains the functions for this object type. If you don't have any clue
where to look, "grep" can help you:

grep -i box * | grep -i intersect

This command outputs all lines that contain "box" and "intersect" (ignoring
the lower and upper case). If you don't have grep or a equivalent program,
install one. Similarly to the above, the command

grep -i reflect * | grep -i ray

gives us the hint to look at the file "lighting.c" where we find the 
function Reflect.

You probably already remarked that the calculation of a ray is distributed
over a lot of files. This is understandable, if you keep in mind how many
features the calculation of a ray might include (pigments, normals, object
types, reflection, refraction, media,...)

I hope this helps.
Thomas

-- 
http://www.thomas.willhalm.de/ (includes pgp key)


Post a reply to this message

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