Skip to main content
GameDev.net gamedev.net
🔒 Locked

Moving a 3D object in screen space

Started by JohnOwens_137089 Apr 15, 2011 at 2:37 PM 1 replies 1.5k views
Original Post
JohnOwens_137089
JohnOwens_137089
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.
Mussi
Mussi
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.