Sign in to follow this  
MefistoManna

How can i translate mesh with vector?

Recommended Posts

I have already traslate a mesh with the function D3DXMatrixTranslation in a precise position of the 3D space. But how can i do to move the mesh in direction with a vector?
Sorry for my english [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] .

Share this post


Link to post
Share on other sites
[quote name='MefistoManna' timestamp='1334942428' post='4933290']
I have already traslate a mesh with the function D3DXMatrixTranslation in a precise position of the 3D space. But how can i do to move the mesh in direction with a vector?
Sorry for my english [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] .
[/quote]

Easiest way is to keep a hold of the position you want is in a vector than when it comes time to actually do the transformation transform it into a matrix.

so in your game logic you can simply do position += velocity or something like that, but when your it comes time to render just do
D3DXMatrixTranslation and multiply the mesh by the matrix.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this