View Single Post
  #3  
Old 06-17-2013, 11:53 PM
Biom Biom is offline
Member
 
Join Date: May 2013
Posts: 2
The steering wheel turns around the origin of the car.
Instead of turning around its own axis, it turns around the aixs of the car.
But if you look at the following script, the wheels turn around there own axis.
I would like the same kind of rotation but then for the steering wheel of the mini.

Code:
import viz

osg = viz.add('SceneGraphTools.dle')

ground = viz.add('tut_ground.wrl')
car = viz.add('mini.osg', pos = [0,0,7], euler = [90,0,0])

# Get raw handle to 'rfr' group node
rfr = osg.getRootNode(car).findChildren('rfr')[0]

# Get handle to children
children = rfr.getChildren()

# Create new raw group node to hold children
tireGroup = osg.addGroup('RightFrontTire')
tireGroup.setChildren(children)

# Insert tire group underneath rfr node
rfr.setChildren([tireGroup])

# Get handle to new group node
tire = car.getChild('RightFrontTire')
spin = vizact.spin(1,0,0,90)
tire.addAction(spin)

viz.go()

Last edited by Biom; 06-17-2013 at 11:56 PM.
Reply With Quote