# Reflection Orientation Problem.

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

## 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 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 on other sites
Awesome thanks, My Ray to plane test was something that i came up with to try to solve the problem, so it was my mistake =P. I appreciate the help =D

1. 1
Rutin
27
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633312
• Total Posts
3011312
• ### Who's Online (See full list)

There are no registered users currently online

×