Advertisement

Rebound/Reflection of lines on planes

Started by July 12, 2002 08:15 AM
1 comment, last by Dreamforger 22 years, 7 months ago
I''ve been wondering if there is a simple solution to the following 3 dimensional problem: A line L crosses a plane P. Where is the line reflected to, assuming standard reflection (no Pong-ish reflection)? I''ve got this:

\
 \L1
  \
   \  
    \  
-----X--------- P
      \
       \L2
 
and want this:

\
 \L1
  \
   \   /L2''
    \ / 
-----X--------- P
      
       
 
Don''t we all just love ASCII art! P is not always a plane in an axis plane. All I''ve been able to cook up was a matrix, set up from X and the normal on P. But it is extremly complex and slow to compute. Do you know a fast solution to this problem? --------------------------- I may be getting older, but I refuse to grow up
I may be getting older, but I refuse to grow up
If it's a reflection like in a mirror, then the answer is pretty simple. As long as what you want is the equation of the resulting line...

Original line: P = P0 + v * t
CP = Collision point of the line and the plane
N = Normal of the plane
Rebounded line: P = CP + (v - 2 * Dot(N, v) * N / |N|²) * t

I think that's it... Maybe you could try it out by hand to check my calculations.

Cédric

Edit: Forgot * t

[edited by - cedricl on July 12, 2002 9:49:45 AM]
Advertisement
Once I saw the formula you posted I remembered that I had seen the same in one of my math books. It ought to work.

From line vector to point I''ll be able to do it myself again :-)

Thank you for replying!

---------------------------
I may be getting older, but I refuse to grow up
I may be getting older, but I refuse to grow up

This topic is closed to new replies.

Advertisement