[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

FW: Re: [ATM] re:Arbitrary ray origins



Specifically, ray propagation depends on the relative vectors of the ray to
the vector normal (coming perpendicularly out of) the surface at the point
the ray hits the surface, and the relative indices of refraction of the two
materials.

So you have to:
1. figure out where on the arbitrary surface the ray will hit
2. determine the vector normal to the surface at that point
Then you can calculate the reflection or refraction.

If I = incident vector
 N = local surface normal vector
 g = index of near material / index of far material
 T = transmitted vector
 R = reflected vector

T = gI + [g(-N dot I) - sqrt( 1 + g²((N dot I)²-1))] N

R = 2(-I dot N)N + I

This actually has a lot in common with computer generated scenes.

A good book is "Object Oriented Ray Tracing in C++" by Wilt.  It is useful
for non programmers because he explains the math well.

A good place to look for such a program would be www.sourceforge.net

=Matt


Original Message:
-----------------
From: Richard F.L.R. Snashall rflrs@rcn.com
Date: Thu, 14 Oct 2004 22:09:37 +0100
To: atm@atmlist.net
Subject: Re: [ATM] re:Arbitrary ray origins




Ellen Mackenzie wrote:
> I received this request and thought someone on the list may have knowledge
> of a program that has this function.
>  
> 1. is it possible to trace an arbitrary ray from an arbitrary surface?
E.g.
> by specifying the coordinates and initial ray angles in the local
coordinate
> system of the surface?
> 

    Assuming it hits the surface in the direction you want it to, yes.

> 2. is it possible to do a reverse ray tracing w/o reversing the system?

    Assuming you know where you are starting the raytrace from,
    the equations are identical, but:

      a)  The relative refractive index is the numeric inverse of what
          it was in the forward trace of the same surface.

      b)  The distances traversed are the negation of those used in the
          forward trace.



-- 

Rick S.

http://users.rcn.com/rflrs

_______________________________________________
ATM mailing list http://www.atmlist.net/


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .


_______________________________________________
ATM mailing list http://www.atmlist.net/