How to compute the pivot point of a rectangular cuboid to achieve a certain rotation?

379 Views Asked by At

Summary:

For a video game project, I have an object (craft) that hovers the ground using a soft constraint. Imagine that on the picture below there is an invisible point above the craft whose attached to it with a thread; since the pivot point is perfectly centered, the ship rotation is flat:

enter image description here

I would like to be able to give it a certain rotation such as below, by specifying an angle: enter image description here

If you take a ruler and let it sit on your finger, you can eventually make it perfectly flat if you center it, but it would quickly fall down if you move the pivot point a bit.

Question:

What are the maths for being be able to compute the pivot point to achieve a certain rotation ?

EDIT: here's a screenshot with some explanations

The magenta line shows the thread that connects the invisible anchor on top, and where it connects to the rectangular cuboid (top face).

enter image description here

Now if I move the pivot point a bit from center, the cuboid will have a certain angle:

enter image description here

So what I'm asking is whether there is a formula I could use to compute the location of the pivot point from an angle, like +10 degrees. (e.g. with this I will be able to restrict the pitch a player can apply to the ship)

1

There are 1 best solutions below

5
On BEST ANSWER

I don't know if I've got your question right. If you are asking where to attach a thread so that your cuboid would be rotated of a certain angle under the influence of its weight, then the answer is very simple: at equilibrium the center of mass (that is the center of the cuboid, I suppose) is directly below the suspension point (or pivot point, as you call it).

If $G$ is the cuboid center, you just need to choose a pivot point $P$ such that the line $PG$ forms an angle $\alpha$ with the vertical, to achieve an equilibrium position which is rotated by $\alpha$.

If $2h$ is the height of the cuboid (from bottom to top face when horizontal), and $Q$ is center of the top face, then to have a rotation of $\alpha$ you can place the pivot at a point $P$ on the top face such that $$ PQ=h\sin\alpha. $$