Jump to content
  • Advertisement
Sign in to follow this  
arkerone

Rotate an object on another

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

Hello,

I have a little problem, I have an object split into two (this is a helicopter) and I would like to turn the propellers of the helicopter, so I applied successive rotations each frame on propellers so that they turn on themselves. The problem is that the helicopter can move in four directions (left, right, down, up) so I applied rotations (20 °) on the helicopter and the propellers but the worry is that propellers no longer remain attached to the helicopter. How to keep "hanging" the propellers on the helicopter?

Here's a video of the problem:

Share this post


Link to post
Share on other sites
Advertisement
Well, it wouldn't because the final matrix of the propeller is a product of the rotation of the propeller and the helicopter's transformation matrix.

Share this post


Link to post
Share on other sites
A child's transformation matrix is always built as its parent's matrix multiplied by the relative transformation matrix from parent to child (or from child to parent).

Parent in this case is helicopter. Its matrix consists of translation of the chopper and its yaw, pitch and roll.
Child is the blades mesh. The relative matrix between blades and chopper consist of the rotation of the blades (plus maybe translation to put the blades to a proper position on the chopper, but this may not be needed if the meshes have proper pivots).

Share this post


Link to post
Share on other sites
Just my 2 cents, but you should accomplish this effect by animating the helicopter, rather than hard coding some transforms.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!