Skip to main content
gamedev.net
🔒 Locked

compute 3d reflection

Started by Little Russian Jun 13, 2009 at 7:36 AM 0 replies 650+ views
Original Post
Little Russian
Little Russian
Does somebody know how to compute the 3d reflection matrix given 2 edges that we know that have been mirrored? I think I solved for rotation and translation: I dot to have the angle, I cross to have the rotation axe and subtract to have the translation. What about the reflection? Thanks.
Dave Eberly
Dave Eberly
If A is a point and B is its reflection through a to-be-determined plane, then the difference B-A is perpendicular to the plane and the average (B+A)/2 is a point on the plane. That is, if N = (B-A)/Length(B-A) and P = (B+A)/2, the plane is Dot(N,X-P) = 0. (Of course, you need to worry when A = B...)

If Y is any point, then Reflection(Y) = Y - 2*Dot(N,Y-P)N. In affine form, this is Reflection(Y) - P = (I - N*Transpose(N))*(Y - P).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.