Sign in to follow this  

Reflection Orientation Problem.

This topic is 4837 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

Hello , I am having a tough time solving this problem. What i am doing is expanding the NeHe 26 tutorial on reflections so that i can reflect off any plane rather then just the floor. What i have come up with thus far ,is that i need to do a Ray to Plane test so that i can use the position of the ball and the Normal of the floor to generate a line that i can translate the position of the ball for the reflection. This all works great. But here is the problem. I am confused on how to handle the orientation of the ball once it gets to its destination so that it is properly reflected off the surface. If anyone has a good remedy for this or a different way to look at the problem please let me know.

Share this post


Link to post
Share on other sites
I haven't looked at the tutorial so I don't understand most of what you are saying -- especially the need for a "ray to plane test".

Anyway, the transformation to do a reflection around an arbitrary plane can be found here. Simply transform the world with this matrix (don't forget to reverse the winding!) and draw to get the reflected image, using the stencil buffer to clip the reflection.

Share this post


Link to post
Share on other sites

This topic is 4837 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this