I am making cement mixer so I want this object (mixer drum) to just rotate but not come out of its base.
I'll try to show here what I said above in comments.
This is the drum from your object and I highlighted its pivot point as it is in the file. I also placed an empty to its current position, as a marker.
But if you think that the pivot point is well positioned, you should try to "recalculate" it origin to the geometry
And you get this: you see it is now a different position... this is what makes the drum to rotate wrongly even after correcting the local axis...
If this mesh was designed better, this following method would have worked, to reset the local Y axis to get a better rotation animation:
first, I selected a ring from the mesh (which is supposed to rotate well around a corrected Y axis), duplicated it as a separate object, and used it to calculate the current rotation using an empty:
the empty is placed at the new ring center (obtained with "origin to the geometry") and in side view, with the help of vertex snap tools, rotated until it matches the ring mesh, and you so you get the (wrong) rotation angle between the empty and the ring.
you then have to use that angle to correct the real "drum" angle
as you see the drum Y local axis has now the right rotation, but if you compare the empty position and the drum pivot, it is easy to understand that this will not work good in animation either...
I cannot model the drum for you (btw I'm on holiday) but at least you know something more than before :D maybe someone else will add more help...
Re-align the local axis.
- Object mode.
- Select the mesh object and transform its origin to center of mass
Object > Transform > to Center of mass (volume).
- Clear the keyframes.
Put view in right ortho Numpad 5 I've also changed to wireframe view Z and rotated the mesh in x (quickly by eye) to align vertically. (See note at bottom). So don't go by the 14.3 in iamge, take care in this step to get best result.
Apply rotation to the object. This will realign the local coordinates.
Object > Apply > RotationctrlA
- Change the euler rotation order to
ZYX EulerThe x tilt wont effect the Y rotation in this order.
- Rotate back to match the tilt, Now can keyframe in Y to make the mixer spin
Ideally would rotate in step 4 to align horizontally. Maxing the axis of rotation z after applying rotation. This would take out the need for step 6