Rotate an object around another objects pivot

So this is an issue I’ve run into time and time again. But basically, what i’m going to end up needing is most likely a mathematical solution. But lets take a pool table for example. We have a top down view of our pool table. We have a pool stick, and a cue ball. The sticks origin is at its center, and the cue balls origin is also obviously at its center. I want the stick to face and rotate around the cueball, as if its origin is the same as the cueballs, even though it is not. I know that you could obviously move the meshes origin in 3D modeling software to achieve this, or you could parent the mesh component to the object you want to move around. Neither of these are solutions that I want. There MUST be a way to achieve this mathematically. The answer in the linked post makes the cue stick orbit the ball, but it does not continue to face the ball. How to make object rotate around another object?

I will greatly appreciate any answers


The easiest way I can summarize it, is look at this image, and think about how you would expect it to behave in a top down billiards game. How would you avhieve that

Let’s imagine the X vector of the pivot point of the ball is facing the cue. Then it’s really just the forward vector of the ball * distance to pivot point of the cue + position of the ball.

Unless, of course, you want to make it worse by generalizing the ball rotation.

If you mean make it worse by ignoring the balls rotation, yes, I don’t want to have to worry about the way the ball is rotated.

What I know is going to have to happen, is both the location and rotation of the stick are going to have to move in such a way, that it appears as though the stick is just rotating around the ball. But i have never been able to figure out the math to do so unfortunately

So why not just use ‘look at rotation’? As long as the X is pointing down the cue, it will always look at the ball.

1 Like

That works, thank you

1 Like