Sign in to follow this  
fatihtolgaata

how to find Character's position in the World?

Recommended Posts

Hi, I was able to put my Skinned Mesh Character Animation to Direct3D World. in 3ds Max, My Character is walking from begin_position to finish_position. I want to make loop this animation in DirectX. So, beginning of the each animation, I have to find the new position of my character. I must write like this: Device->BeginScene(); Device->SetTransform(D3DTS_WORLD, &NewPositionOfCharacter); MyCharacter->DoAnimation; Device->EndScene(); But How can I determine and find the New position of character after finishing the animation?

Share this post


Link to post
Share on other sites
What bones does your character have near it's root? Are you using a model from character studio? A pre-made model like Tiny?

If you inspect the matrices of one of the top-level bones, you'll notice the matrix translation coordinates (._41, ._42, and ._43) will keep climbing. Those three attributes of that matrix is your character's position, in x,y,z order.

Share this post


Link to post
Share on other sites
Hi there :)
I can think of a number of ways to do this.

Option 1
Don't move the character around with animation but do this with a Matrix. The matrix will then give you the details as to where the character is in space


Option2
Is a technique that Jiia already specified is the extract the matrix information when you need the coordinates.

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