Copy link to clipboard
Copied
Good day,
This is breaking my head and then some. I have content that need to rotate around its centre. I want to do this with this expression:
Rotating expression:
amplitude = 1; // Reduced for less tilting
frequency = 0.2; // Slower movement
rotation = amplitude * Math.sin(time * frequency * 2 * Math.PI);
-rotation // Invert the tilting motion to simulate correct movement
Position expression:
amplitude = 60; // Increased for more pronounced bobbing
frequency = 0.2; // Slower movement
y = amplitude * Math.sin(time * frequency * 2 * Math.PI);
value + [0, y]
When use this the rotation seems off centre. What am I missing?
thanks.
Its part of a position and rotating expression where the movement of a ship is simulated. The problem however is that the tilting doesnt seem to be happening from the centre, even as the anchor point is in the centre.
Copy link to clipboard
Copied
When the rotation axis (anchor point) moves around the screen, especially randomly, the center of rotation will look like is moving.
Delete the Position expression and add it to the Anchor Point. The rotation should now appear to be around the same point. Try it on a layer that is 800 X 2 pixels with the anchor point at 0, 0.
Copy link to clipboard
Copied
Good morning, thank you,
That is the weird part. It looks like the rotation is originated from the bottom left corner.....I checked and double checked. Whe i apply this expression to 4 different comps they all behave the same....like the centre of the rotation is at the bottom left corner resulting in the fact that this corner/side will not tilt or rotate.