Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Moving a 3D object in screen space


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Adversus   Members   -  Reputation: 100

Like
-1Likes
Like

Posted 15 April 2011 - 08:37 AM

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.

Sponsor:

#2 Mussi   Crossbones+   -  Reputation: 962

Like
0Likes
Like

Posted 15 April 2011 - 03:28 PM

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.

#3 Adversus   Members   -  Reputation: 100

Like
0Likes
Like

Posted 19 April 2011 - 08:09 AM

Thanks that worked great.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS