Changing rotation pivot at run-time

Started by Irony, April 06, 2013, 03:24:19 PM

Previous topic - Next topic

Irony

There is a cylinder C with two dummy child objects at the top (T) and bottom(B).
I set C's rotation pivot to B, and do some rotations which work as expected.

When I switch the rotation pivot to T, C suddenly switches its orientation.
I suppose this happens because the new pivot point gets "melted" with the existing rotation matrix.

Is there a way that I can keep the orientation of C as it is, while still having a new pivot point for future rotations?


edit: I had a stupid error in my code that caused the orientation change. The problem now is that the object makes a "jump" when I change the pivot. Probably still an issue with my code though.

EgonOlsen

Rotations are cumulative and will be applied around the current rotation pivot. If you change the pivot at runtime, all former rotations will be applied using the new pivot. That will cause the jump effect that you experience.

Irony