• Advertisement
Sign in to follow this  

XNA,how to convert 3d world coordinate into screen coordinate

This topic is 2659 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Could someone know how to convert 3D world coordinate into screen coordinate?

First method:
1.create vertex buffer and set vertex coordinate with a 3D point of certain poistion
2.set basic effect with world matrix,view matrix,projection matrix individullay
3.draw the 3D point

Second method:
1.create vertex buffer
2.transform the 3D point of certain position with world matrix*vie matrix*projection matrix
3.set vertex coordinate of vertex buffer with transformed 3D Vector3(step2)
4.set basic effect's world matrix, view matrix and projection matrix with Matrix.Identity
4.draw the 3D point

I know the first method is correct. But the result the second method is incorrected. Because the transformed Vector3 is outside of camera, event it should in the camera view.

Share this post


Link to post
Share on other sites
Advertisement
There was a similar question answered in this thread:

http://www.gamedev.net/community/forums/topic.asp?topic_id=586543

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement