Jump to content
  • Advertisement
Sign in to follow this  
winsrp

rotate object base on another

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

So I was doing my char today as I have some land and collisions up an running, so this is what I have so far for testing purposes so please don't laugh.

[attachment=7101:char.png]

But when I move the char around and rotate it, !!! the legs and arms seem to rotate around themselves and not around the body. So this has to do something with the rotation of the world matrix for the body, I do get that, what I don't get is how to make it work.

[attachment=7102:charwrong.png]

This is not a char made out of meshes with bones and stuff, those are just 6 blocks, each one on its own vertexbuffer, as I figured out that I cannot modify objects separately if I don't have them on their own vertexbuffer.

Help please.

Share this post


Link to post
Share on other sites
Advertisement
for posterity I found the solution to my problems,


Store body matrix, without scaling,
when moving parts of the body (i.e. hand), first apply scaling, then translation (based on the body not the matrix.identity) the apply the body matrix you had stored, that should give you the part correctly moved.

thanks anyway.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!