i was wondering if anyone could give me some advice on how to rotate one object around another moving object. After a bit of googling i found some code on another website that worked perfectly but it would only work on staitionary objects. The code that i used:
Vector3 temp = objectPosition - objectToRotateAboutPosition; temp = Vector3.Transform(temp, Matrix.CreateRotationX(angle)); objectPosition = objectToRotateAboutPosition + temp;
It works perfectly on the staitionary object but on a moving object it seems to object that is orbiting the main object seems to distance itself a great distance before it returns to the original position. I was wondering if anyone knew a way that i could tweak this code blocka and make it work, or maybe a different way to rotate one object around a moving object.