• Advertisement
Sign in to follow this  

My Reflection, please look and help

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

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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.

Share this post


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

  • Advertisement