POV-Ray : Newsgroups : povray.general : which mathematics does POV-Ray use? : Re: which mathematics does POV-Ray use? Server Time
30 Jul 2024 04:22:34 EDT (-0400)
  Re: which mathematics does POV-Ray use?  
From: Tim Attwood
Date: 17 Nov 2009 16:04:24
Message: <4b030fd8$1@news.povray.org>
"marky.addison" <mar### [at] gmailcom> wrote in message 
news:web.4b027fcf58e10a053a7b232a0@news.povray.org...
> clipka <ano### [at] anonymousorg> wrote:
>> marky.addison schrieb:
>>
>> > what I need are differential equations that POV-Ray uses.
>> > Can you send me some link. Thanks!
>>
>> Could you be somewhat more specific?
>>
>> At its core, raytracing is about vector math, not differential
>> equations. There are pretty likely some underlying differential
>> equations involved for stuff like the fresnel formula used in
>> refraction, or the phong / blinn-phong highlights, but someone else
>> wrecked their brains earlier to come up with quite simple equations,
>> with all integrals or derivatives either solved or approximated already.
>>
>> As for radiosity, it does perform some integration, but it does so
>> numerically using a monte-carlo-like approach.
>>
>> I really wouldn't know off the top of my head where you expect to be
>> differential equations involved.
>
> Clipka thank you very much for your cooperation. ;)
>
> I am trying to figure out what mathematics does POV-Ray use.
> Does it use more Raytracing or Radiosity or it combines both?
> How does it make shadows (isn't it with radiosity)?
> So I need some formulas, integrals and derivatives so I can
> better understand how it works.
>
> Thanks

What is going on is that a ray is being represented as a formula...

location = point + time * direction (where time > 0)

and an object is being represented by it's geometric formula,
for example a sphere...

X^2+Y^2+Z^2 = radius^2

and then the ray formula is being substituted into the objects'
formula ...

(point_x + time*direction_x)^2 +
(point_y + time*direction_y)^2 +
(point_z + time*direction_z)^2 = radius^2

and then this formula is solved for time, (in the sphere case using
the quadratic formula). From there you substitute the time back
into the ray formula to find the location of the intersects.

To calculate shadows another ray is cast from the intersection
point (A) at the light locations, if some other scene object has an
insection (B) with that shadow ray closer than the light then the
intersection point (A) is not illuminated by the light, so it's a darker
pixel.

Here's some links...
http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter0.htm
http://www.cl.cam.ac.uk/teaching/1999/AGraphHCI/SMAG/node2.html

Some college math and programming classes assign a toy ray-tracer as
a programming project, is that what you are doing?


Post a reply to this message

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