# My Reflection, please look and help

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

## Recommended Posts

Hey I am trying to achieve planar reflections using stencil buffer and arbitary planes. ATM this is how i find my reflection matrix. An objects matrix is defined as Rotx * Roty *Rotz * Translate And so the inverse matrix moves it back to the origin, by mutliplying the scene with the inversematrix like this glMultMatrixf(objInversematrix); glScalef(1,-1,-1); glMultMatrixf(objMatrix); I get my reflection matrix. Please check my app and see if the reflection is correct. I will post more source code if needed. http://rmcommando.co.uk/reflectionmatrix.zip

##### Share on other sites
Quote:
 glScalef(1,-1,-1);

why are you inverting the z axis as well as the y axis?

if you are inverting around a plane pointing upward, just flip the y axis.

you should also be aware that using negative sizes within glScale are likely to mess up lighting equations etc.

##### Share on other sites
Quote:
Original post by Exorcist
Quote:
 glScalef(1,-1,-1);

why are you inverting the z axis as well as the y axis?

if you are inverting around a plane pointing upward, just flip the y axis.

you should also be aware that using negative sizes within glScale are likely to mess up lighting equations etc.

Yes I noticed the double inverting as well, I don't know. If i just invert the one axis it doesn't work right.

IF negative scalling effects lighting how do i get around it?

I think the double scaling could be because the plane is rotated 90 degrees.

1. 1
Rutin
26
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 10
• 10
• 9
• 9
• 10
• ### Forum Statistics

• Total Topics
631752
• Total Posts
3002091
×