Start a new topic

How do I assign the center of rotation around the center of gravity on my model?

I currently have a vehicle created and modeled within the world, and am rotating it with an external device. The rotations made to the vehicle are centered around the front assembly and not at the center of gravity though. How would I shift the focus point of all rotations around the center of gravity?

1 Comment

Hi Eric,


Just to be clear, I assume you're rotating the vehicle by directly setting the transform, as opposed to applying a moment to a dynamic part? If applying a moment, the application point doesn't matter, as the effect of moments doesn't change with application point.


If you're just setting the transform of a model that is set as 'animated', then the transform you apply will set the position and rotation of the origin of the object you transform. So if you set the transform of a mechanism, it's the origin of the mechanism that will match the transform you set.


If you would rather move a mechanism with respect to a different origin, there are two things you could try:


Change the origin of the mechanism: While you don't specifically set the origin of a mechanism in Vortex, in effect you choose the origin by moving everything inside the mechanism. If the origin is currently the bottom front of the vehicle, you can open the mechanism and move the assembly(ies) forward and downward so that the origin of the mechanism (visible as the intersection of the red and green lines) is at the CoM. See the attached image. 


Offset your transformation: Another way if you don't want to change your assets is to do a transformation in your script before writing it to the mechanism transform. Basically you do the math needed to put the actual origin in the right place so that your CoM ends up in the place you want it. You could manually do the geometry calculations to figure out the position of the origin given the known CoM, but it can be done easily with the transform linear algebra used inside the scripts. Assuming you have a script with Matrix44 variables OriginTransform and CoMTransform, and an vector from the CoM to the mechanism origin of (1.5, 0, -0.8), this should work:


    offset = VxSim.createTranslation(1.5, 0, -0.8

    OriginTransform = CoMTransform * offset

com.png
(52.2 KB)
Login to post a comment