# 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.

## 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 on other sites
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 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

1. 1
2. 2
Rutin
22
3. 3
4. 4
5. 5
khawk
14

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633742
• Total Posts
3013639
×