WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-03-2014, 01:37 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
I think this should fix your problem:
Code:
import viz
import viztask
import vizact

viz.go()
viz.eyeheight(0)
viz.MainView.setPosition(0,0,-4)

car1 = viz.add('box.wrl')
rim1 = viz.add('box.wrl', color = [0,0,1])
car2 = viz.add('box.wrl', color = [1,0,1])
rim2 = viz.add('box.wrl', color = [0,1,0])

action1 = vizact.spin(0,0,1,60)
action2 = vizact.moveTo([-2,0,2],speed=2.00, interpolate=vizact.easeOut)
action3 = vizact.moveTo([-2,0,2],speed=4.00, interpolate=vizact.easeOut)

def actionTime():
	rim1.addAction(action1,0)
	rim2.addAction(action1,0)
	car1.addAction(action2,0)
	car2.addAction(action3,0)
	
vizact.onkeydown(' ', actionTime)
	
def onActionEnd(e):
	if e.object is car1:
		rim1.endAction(0)
	elif e.object is car2:
		rim2.endAction(0)

viz.callback(viz.ACTION_END_EVENT,onActionEnd)
In this example, the green box (rim2) is the rim of the purple box (car2), and the blue box (rim1) is the rim of the red box (car1). The red and purple box arrive at different times at the end position, and the rotation of their rims stop accordingly. Replace the boxes with your appropriate models, and you should be good to go!

Last edited by Frank Verberne; 01-03-2014 at 01:43 AM. Reason: improved readability of code
Reply With Quote
 

Tags
car wheel rotation


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
Steering wheel mini Biom Vizard 2 06-17-2013 11:53 PM
Custom Joystick Rotation mhead10 Vizard 9 11-26-2012 12:06 PM
Changing Force-feedback on Wheel Cage Vizard 3 10-23-2010 08:37 AM
set bone rotation - cal3d munteanu24d Vizard 0 03-23-2010 04:25 AM
Unable to perform 360 rotation using vizact.spinto vijaykiran Vizard 2 09-29-2009 08:39 AM


All times are GMT -7. The time now is 09:24 PM.


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