h______f

01-05-2001, 12:35 AM

hello,

i am new to this board, any help or hints with this problem would be very much appreciated:

i've been reading through several articles on opengl reflection and i seem only to find something about reflection on any of the XY, XZ, YZ planes using something like:

glScalef(0.0,-1.0,0.0);

now i can transform any model by the inverse of the mirror transformation matrix (putting the reflection plane back to the origin), do the reflection and rotate it back to it's original position.

But, if it was possible, it would be much more comfortable to just use one reflection matrix. i've used a shadow projection matrix and it seems to me that if you can project any point to any arbitrary plane in space, it should also be possible to do the same with reflection.

given:

P' (the original point)

P'' (the reflected point)

n (the normal vector of my reflection plane)

P' -> P'' should be P'+x*n

(x would be twice the distance between my original point and the plane)

is there a way to resolve that to a matrix ?(should have paid attention in school)

thanks a lot...

[This message has been edited by h______f (edited 01-05-2001).]

i am new to this board, any help or hints with this problem would be very much appreciated:

i've been reading through several articles on opengl reflection and i seem only to find something about reflection on any of the XY, XZ, YZ planes using something like:

glScalef(0.0,-1.0,0.0);

now i can transform any model by the inverse of the mirror transformation matrix (putting the reflection plane back to the origin), do the reflection and rotate it back to it's original position.

But, if it was possible, it would be much more comfortable to just use one reflection matrix. i've used a shadow projection matrix and it seems to me that if you can project any point to any arbitrary plane in space, it should also be possible to do the same with reflection.

given:

P' (the original point)

P'' (the reflected point)

n (the normal vector of my reflection plane)

P' -> P'' should be P'+x*n

(x would be twice the distance between my original point and the plane)

is there a way to resolve that to a matrix ?(should have paid attention in school)

thanks a lot...

[This message has been edited by h______f (edited 01-05-2001).]