Jump to content
  • Advertisement
Sign in to follow this  
JohnOwens_137089

Moving a 3D object in screen space

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

Hi I want to move a 3D object 50 pixels down in the screen and I can't figure out the maths to that.

I have the projection, model and view matrices plus all the screen dimensions. Could some tell me how to do this?

Cheers,
John.

Share this post


Link to post
Share on other sites
Advertisement
Basically you'll need the object's position to go from model space to world space, from world space to camera space, from camera space to screen space and then reverse the order after you've shifted the screen space coordinate by 50 to get the new position. If you are using using DirectX or OpenGL there are built in functions for this. For DirectX these would be D3DXVec3Project and D3DXVec3Unproject, don't know the OpenGL function names.

Share this post


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

  • 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!