Archived

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

Klaatu

Camera space

Recommended Posts

I''ve recently started to delve into Direct3D. I am converting an OpenGL app to DirectX. I have already run into a problem that has stumped me for the last week. I''ve either got a bug or a lack of basic understanding on camera space. Here''s what''s happening: I am trying to render an untranslated "point". The point is at (-0.568,0.465). I set the world matrix to be identity. The view matrix is set using D3DXMatrixLookAtLH(). I specify an eye point at (0,0,-5) and a look at pt at (0,0,0). The up vector is (0,1,0). When the "point" renders, it is displayed at (-0.568,-0.465). If I adjust the eye pt, I can get the point to move to (0.568,-0.465) but never to where I want it. Can anyone shed some light on this? TIA Gort...Klaatu, Barada Nikto!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Direct3D uses a left-handed coordinate system. +Z goes into the screen, -Z comes out. Maybe that''s your problem?

<a href="http://www.evl.uic.edu/ralph/508S98/coordinates.html">http://www.evl.uic.edu/ralph/508S98/coordinates.html</a>

Share this post


Link to post
Share on other sites
An update:

I was able to resolve this problem. The problem was caused by a bug in the way the projection matrix was established. My advice - pay particular attention to how matrices are used and multiplied.

Gort...Klaatu, Barada Nikto!

Share this post


Link to post
Share on other sites