Jump to content
  • Advertisement
Sign in to follow this  
stefandwight85

the distance between two points via a reflection from a plane

This topic is 3667 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all i am currently working on a prgram which models reverberation in a room and sets the signal processing on soundcard according to the room model. however the probelm that i have is i need to be able to calculate the time difference between the direct sound and the reflected sound. i know how to calculate this if the source and reciever are fixed as the triginmoetry can be hand written, however i would like to be able to move the source and receiver so i need to be able to calculate the shortest distance between the source and reciever via a reflection of one of the walls hope someone can help stefan

Share this post


Link to post
Share on other sites
Advertisement
You are trying to compute the distance between A and B when bouncing on a plance P. Transform either A or B to its symmetric point with respect to P (for instance, if P is z=0, convert (x,y,z) to (x,y,-z)). Then compute the distance normally.

Share this post


Link to post
Share on other sites
Having a coffee break, so opened up ms paint to help solve your problem.

Free Image Hosting at www.ImageShack.us
Click for bigger

I think this what you are trying to do. You need to find the closest points on plane P for A and B (we shall call C & D respectively.) Next create vectors AD & BC and where these two lines cross you find the closest point again to the plane to find the point of reflection(lets call it E.) To find the incident angle you just use simple trigonometry using any combination of the distances of AC/CE/AE, and for reflection use BD/DE/BE.


Edit: added all lables to image.

Share this post


Link to post
Share on other sites
It Seems to me, there's an easier way.

[Edit : Just noticed this is the same as Alvaro's method]

First Reflect either point in the plane... (Let's say A from Moomins Diagram)

There are plenty of ways to do that..
You can build a reflection matrix for the plane... handy if you are planning to do a "load" of points
or from your plane equation (ax + by + cz + d = 0.. or p.n + d = 0)
A' = A - 2*(A.n+d)n
or...

Anyway you then simply calculate the distance from the reflected point to the position of other point.
Lengthof(A'B) ... and that's your answer.

HTH

[Edited by - daftasbrush on June 10, 2008 12:43:19 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!