Jump to content
  • Advertisement
Sign in to follow this  
Zwigby

weird math problem

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

I am having a problem with the math to find the right position of a mesh that i want to stay in the same spot relative to another mesh that moves around including rotating around the x, y, z axis. Basically the way i am doing it now it is, I know how far it should be if there were no rotation then i am using the angles to find how far this relates with rotated. But the problem is when the angle of rotation around the x, z axis gets large the second mesh, the one supposed to follow the other mesh, starts moving around a little, it moves a little in all three axes. I am not sure that i explained this well, just ask for more details and i am willing to try anything at this point. Basically the overall thing is trying to get a turret to stay with a tank base while the tank moves all over the terrain. Zwigby

Share this post


Link to post
Share on other sites
Advertisement
couldn't you just rotate/translate it in the same way that the tank moves? I assume they have some way to "see" each other, so if, say, the tank is told to move 10 feet north and rotate 30 degrees, it could then in turn tell its attached turrets to do the same thing.

Share this post


Link to post
Share on other sites
just wanted to update you, we decided to rotate our turret around the tank center and then just translate it with the tank, thanks for the advice. It seems to work now. We figured out some things with how directx does rotation and translation to help us out.

zwig

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!