My Reflection, please look and help

Started by
1 comment, last by dawidjoubert 17 years, 8 months ago
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
----------------------------

http://djoubert.co.uk
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.

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.
----------------------------

http://djoubert.co.uk

This topic is closed to new replies.

Advertisement