- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey there,
I needed some help, please. I need a matrix formula that returns the inverse of what D3DXMatrixLookAtLH normally would.
The inverse of this matrix can be used to transform objects to vEyePt and orient them along vLookAt and vUp if the inverse is used. However, using D3DXMatrixInverse is slow.
Here is the formula MSDN defines for D3DXMatrixLookAtLH.
zaxis = normal(At - Eye)
xaxis = normal(cross(Up, zaxis))
yaxis = cross(zaxis, xaxis)
xaxis.x yaxis.x zaxis.x 0
xaxis.y yaxis.y zaxis.y 0
xaxis.z yaxis.z zaxis.z 0
-dot(xaxis, eye) -dot(yaxis, eye) -dot(zaxis, eye) 1
Thanks in advance!
-Steve
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Figured it out myself. Thanks anyway!
Inverse of D3DXMatrixLookAtLH:
zaxis = normal(At - Eye)
xaxis = normal(cross(Up, zaxis))
yaxis = cross(zaxis, xaxis)
xaxis.x xaxis.y xaxis.z 0
yaxis.x yaxis.y yaxis.z 0
zaxis.x zaxis.y zaxis.z 0
eye.x, eye.y, eye.z, 1

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page