Matrix4x4.CreateLookAt gives incorrect result in both LH & RH orientations. #74805
Replies: 2 comments 1 reply
-
In #34859 it is stated...
in left-handed you do target - position I don't understand that, forward is always target - position in any orientation. By definition. It's easy to see... LH RH There is nothing different about them. |
Beta Was this translation helpful? Give feedback.
-
It does look like the These types were largely supposed to mirror functionality from XNA, so I'd need to go back and double check that implementation to see if the reason for this difference. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If I feed the following arguments to CreateLookAt ...
// a camera looking from the origin to the +z-axis
eye = 0,0,0
forward = 0,0,1
up = 0,1,0
I get
This is incorrect in both LH and RH systems.
The LH matrix should be
and the RH matrix should be
My understanding of the view matrix is as follows...
(r = right, u = up, f = forward, p = position)
From https://www.3dgep.com/understanding-the-view-matrix/
It's easy to see that the CreateLookAt function fails in both LH & RH systems because it inverts the forward <0,0,1> vector that I passed in to a <0,0,-1> vector.
What's going on?
Beta Was this translation helpful? Give feedback.
All reactions