Advertisement

reflection matrix error

Started by February 16, 2003 02:28 PM
-1 comments, last by Seriema 22 years ago
Hi! I'm trying to do reflections in OpenGL. I'm using a reflection matrix I found, but there's something wrong... I'm probably not using it right? I get a really weird distortion in the image, I think it's because the "scalar part" for z of the matrix is -10. P = centerpoint on reflective quad = { 0,0,-5 } N = quad normal = { 0, 0, 1 } d = P dot N refl matrix:
      
1-2*N.GetX()*N.GetX(),	-2*N.GetX()*N.GetY(),	-2*N.GetX()*N.GetZ(),	2*d*N.GetX(),
-2*N.GetY()*N.GetX(),	1-2*N.GetY()*N.GetY(),	-2*N.GetY()*N.GetZ(),	2*d*N.GetY(),
-2*N.GetZ()*N.GetX(),	-2*N.GetZ()*N.GetY(),	1-2*N.GetZ()*N.GetZ(),	2*d*N.GetZ(),
0,		0,		0,		1
    
can anyone tell me why the image is so distorted? [edit - source looked ugly] [edited by - Seriema on February 16, 2003 3:30:22 PM]
[ ThumbView: Adds thumbnail support for DDS, PCX, TGA and 16 other imagetypes for Windows XP Explorer. ] [ Chocolate peanuts: Brazilian recipe for home made chocolate covered peanuts. Pure coding pleasure. ]

This topic is closed to new replies.

Advertisement