POV-Ray : Newsgroups : povray.off-topic : Ray tracers and transformations : Re: Ray tracers and transformations Server Time
10 Oct 2024 17:18:49 EDT (-0400)
  Re: Ray tracers and transformations  
From: Nicolas Alvarez
Date: 13 Mar 2008 16:32:13
Message: <47d99d5d$1@news.povray.org>

> I have a "fully" working path tracer under development. The next thing
> to implement is transformations (at least translate and rotate). What is
> the best (fastest) way to do it?
> 
> Let's take box for example. Now I have a method for calculating
> axis-aligned box intersections. So if I rotate the box how should I
> proceed?
> 
> I was thinking that maybe I should not rotate the box, but rotate the
> ray so that I can use the fast AABox intersection routines. And then I
> get intersection point and surface normal, which I rotate back to world
> space?
> 
> Am I missing something here and is the the best way to do it?

As far as I know, the way POV-Ray does it (and probably most others) is 
by creating a transformation matrix of all the individual 
transformations, then inversing it, and using it to transform *rays* 
before doing the intersection calculations.

But don't trust me on this. I still haven't managed to solve the 
ray-sphere intersection equation...


Post a reply to this message

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