WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   minicooper (https://forum.worldviz.com/showthread.php?t=2452)

shahramy 01-02-2010 07:19 AM

minicooper
 
hi every body. i have used mini cooper in my project and move it. but i can`t spin the wheels. please help me how can i do it?

Jeff 01-05-2010 04:39 PM

You can do this but you'll need to use an undocumented Vizard plugin called SceneGraphTools.dle. Here is an example that spins the right front wheel.

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()


shahramy 01-13-2010 11:58 PM

thankyou. but how can I get this undocumented Vizard plugin?

Jeff 01-14-2010 12:23 PM

The plug-in is included with the Vizard install. Just make sure your version of Vizard is up to date and you should be able to run that script. You can check that by going to Help --> Check for Updates.

shahramy 01-23-2010 12:30 PM

thanx a lot


All times are GMT -7. The time now is 01:03 PM.

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