Vizard 7 » Content Creation » 3D Models » OSG Workflow » Pivot Points
7.7

Pivot Points

The pivot point (local origin) of an object created in Max can be visualized in Inspector. It is represented by an axes and can be toggled on/off using the View > Selection Origin option:

Rotate Sub-Parts in Vizard

To rotate a sub-part of an object around its local origin use the <node3d>.getTransform command:

model = viz.addChild('hierarchy_model.osgb')

#Get a handle to a linkable object for controlling the teapot transform
teapot = model.getTransform('Teapot001')

#Create a spinning action and rotate the child object
#around it's local origin
spin = vizact.spin(0,1,0, 90)
teapot.addAction(spin)

The following image shows the resulting rotation in Vizard:

The <node3D.getChild> command inserts a transform above the specified child node. The new transform inherits the coordinate system of the object directly above it.  Using getChild in the code above would result in rotations around the plane's origin.

Change the Pivot Point

To change the pivot point of an object in Max:

  1. Select the object,
  2. Click the Hierarchy tab
  3. Click Affect Pivot Only

The pivot is represented by the wide arrow axes (image A). Activate Select and Move to move the pivot point (image B):

In order for Vizard to recognize the new pivot point:

  1. Click on the Utilities tab
  2. Click Reset XForm
  3. Click Reset Selected

Verify the New Pivot in Inspector

The quickest way to verify the pivot will work in Vizard is to preview the model in Inspector:

The resulting rotation is shown in the image below: