Vizard 7 » Command Index » Vizard objects » node3d » <node3d>.setCenter
7.6

<node3d>.setCenter

Set the center of rotation and scaling

<node3d>.setCenter(  
[x,y,z]  
)  
[x,y,z]
The center of the object, relative to its local coordinate system.

Remarks

This sets the point to rotate and scale the object about, relative to its local coordinate system. The default center is [0,0,0].

Return Value

None

Example

import viz
import vizact
import vizshape
viz.go()

# Create object with offset center and spin around it
model = viz.add('beachball.osgb',pos=(0,0,10))
model.setCenter([1,0,1])
model.addAction(vizact.spin(0,1,0,45))

# Add sphere representing objects center
vizshape.addSphere(radius=0.1, pos=model.getCenter(), parent=model)