Skip to main content
gamedev.net
🔒 Locked

Mirroring rotations

Started by samn Nov 25, 2001 at 11:57 AM 0 replies 950+ views
Original Post
samn
samn
Does anybody out there know how to mirror a rotation about, say, the YZ plane? My rotations are represented by quaternions (although they could be converted to matrices), so I don''t have access to each individual euler angle, which makes it somewhat more tricky... Cheers, Sam
invective
invective
If you are using DirectX 8 then I think what you want is D3DXMatrixReflect on your rotation matrix, otherwise, see the documentation for the function for how it constructs the matrix:

  
D3DXMATRIX* D3DXMatrixReflect(
D3DXMATRIX* pOut,
CONST D3DXPLANE* pPlane
);
Builds a matrix that reflects the coordinate system about a plane

This function uses the following formula to compute the returned matrix.

P = normalize(Plane);

-2 * P.a * P.a + 1 -2 * P.b * P.a -2 * P.c * P.a 0
-2 * P.a * P.b -2 * P.b * P.b + 1 -2 * P.c * P.b 0
-2 * P.a * P.c -2 * P.b * P.c -2 * P.c * P.c + 1 0
-2 * P.a * P.d -2 * P.b * P.d -2 * P.c * P.d 1


Topic Locked

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

Sign in to reply to this topic.