Archived

This topic is now archived and is closed to further replies.

Endurion

When D3DXMatrixLookAtLH == Identity?

Recommended Posts

Hi, i'm using a LookAt matrix to orientate my objects (yes, overly complicated), so i can tell my object "look at vector xyz" or look in direction xyz. I'm using D3DXMatrixLookAtLH for this and it works quite nice. Now one problem keeps arising in different projects. In the beginning i want to have the matrix set to identity. Now here's the question: Which parameters/vectors actually set LookAtLH to identity? Do they depend on the view matrix? Or other dependencies? With try and error i can always figure good settings, but those vary from project to project (with different view matrices). I'd like a foolproof method for setting those three vectors (pos,lookat,lookup) so that they don't translate/rotate/skew the object in any way. Can you help? [Edit:] Ok, i found a solution, obviously D3DXVECTOR3( 0, 0, 0 ) D3DXVECTOR3( 0, 0, 1 ) D3DXVECTOR3( 0, 1, 0 ) seem to do the thing i wanted. I'd still like to know if this is the one true solution or if there's a downfall to it. Many thanks in advance, Endurion [edited by - Endurion on April 23, 2004 4:33:15 AM]

Share this post


Link to post
Share on other sites
yep it's dat.

With a Left hand System, the +Z is pointing in direction through the screen, +Y up, +X left.

With a Right hand system, only the direction througth become -Z.

so an Identiy will be achieved with D3DXMatrixLookAtLH() with origin(0,0,0) lookat(0,0,1) lookup(0,1,0)
and with D3DXMatrixLookAtRH(), the lookat change to (0,0,-1)

[edited by - bjone on April 23, 2004 8:49:00 AM]

Share this post


Link to post
Share on other sites
i would say that a matrix transpose equals a matrix inverse ONLY when you''re talking about a 3x3 rotation matrix.

Share this post


Link to post
Share on other sites
quote:
Original post by bjone
i would say that a matrix transpose equals a matrix inverse ONLY when you''re talking about a 3x3 rotation matrix.


This is true for all symmetric matrices

Share this post


Link to post
Share on other sites
quote:
Original post by bjone
i would say that a matrix transpose equals a matrix inverse ONLY when you''re talking about a 3x3 rotation matrix.


Actually, I believe it''s also true for any matrices which contain only rotations and uniform scales.

I like pie.

Share this post


Link to post
Share on other sites