Jump to content
  • Advertisement

Archived

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

nlo

3D object coord convert to 2D screen coord ??

This topic is 6112 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

as title said, anyone know how to convert object''s world coord to 2D screen coord ?? thanks for help !

Share this post


Link to post
Share on other sites
Advertisement
"Transform" it.

1. Multiply it by the current 3D world matrix.

2. Multiply it by the current 3D view (camera) matrix.

3a. Expand it to a 4D point with a 4th component (called W).

3b. Set W to 1.

3c. Multiply it by the current projection matrix.

4. Divide X, Y and Z by W.

5. Apply the current viewport.

6. Congratulations your point is now in device space.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!