WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-29-2013, 06:10 AM
Biom Biom is offline
Member
 
Join Date: May 2013
Posts: 2
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)
Any help is welcome
Reply With Quote
  #2  
Old 06-17-2013, 09:00 AM
Jose Jose is offline
Member
 
Join Date: May 2013
Posts: 5
Could you explain better, The Steering wheel turns the orientation of the car body?
Reply With Quote
  #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
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 08:31 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC