![]() |
|
|
|
#1
|
|||
|
|||
|
Steering wheel mini
In a previous post I read about the possibilty to control the wheels of the mini.osg
Is it possible to control the steering wheel as well I've tryed this, but the steering wheel turns around some orientation of the car. How can change this? Code:
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
steering = osg.getRootNode(car).findChildren('steeringwheel')[0]
# Get handle to children
children = steering.getChildren()
# Create new raw group node to hold children
steerGroup = osg.addGroup('SteeringWheel')
steerGroup.setChildren(children)
# Insert tire group underneath rfr node
steering.setChildren([steerGroup])
# Get handle to new group node
wheel = car.getChild('SteeringWheel')
spin = vizact.spin(0,1,0,90)
wheel.addAction(spin)
|
|
#2
|
|||
|
|||
|
Could you explain better, The Steering wheel turns the orientation of the car body?
|
|
#3
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing Force-feedback on Wheel | Cage | Vizard | 3 | 10-23-2010 08:37 AM |
| How to create mini car driving by wiimote | superantTTY | Vizard | 7 | 05-18-2010 05:18 AM |
| G25 steering wheel range ! | moneim230 | Vizard | 2 | 03-28-2010 03:54 PM |
| Mac Mini Sound Server ? | djdesmangles | Vizard | 3 | 05-14-2009 12:44 PM |
| Do you have some idea about the bicycle and wheel | sled | Vizard | 6 | 08-01-2003 10:03 PM |