WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 09-08-2008, 09:21 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Since there is a link between the animation path and the car you can offset the car's position or orientation from the path's. If I understand correctly you want to offset the orientation so that the car is facing the opposite direction. Here is some code that takes 2 wheelbarrows and animates them along a path. The second wheelbarrow will get rotated so it faces the opposite direction. Then its position is offset slighty from the path so it appears below the first one. Let me know if that helps.

Code:
import viz
viz.go()

wheel1 = viz.add('wheelbarrow.ive')
wheel2 = viz.add('wheelbarrow.ive')

path = viz.add(viz.ANIMATION_PATH)

positions = [[0,0,10],[5,0,10],[5,0,15],[0,0,15]]

for x in range(0,len(positions)):
	cp = viz.add(viz.CONTROL_POINT)
	cp.setPosition(positions[x])
	path.add(cp,x+1)
	
path.constantspeed(viz.ON,1)

path.loop(viz.LOOP)

path.translatemode(viz.BEZIER)

path.setAutoRotate(viz.ON)

#link the first wheelbarrow to the path
wheel1.link(path)

#link the second wheelbarrow to the path then
#offset the wheelbarrow's orientation so it is opposite the path 
#and offset its position from the path so it will be 
#below the first wheelbarrow

wheel2link = viz.link(path, wheel2)
wheel2link.preEuler([180,0,0])
wheel2link.preTrans([0,-1,0])

path.play()
Reply With Quote
 


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
General question and question regarding arrays dan12345 Vizard 1 01-15-2008 10:15 AM
Animation Tracks.... k_iwan Vizard 2 03-26-2007 05:52 PM
Jumpy animation Elizabeth S Vizard 1 11-08-2006 02:11 PM
avatar animation problems jrodman Vizard 1 01-18-2006 09:12 AM
to rephrase my question... shai Vizard 2 10-27-2004 10:55 AM


All times are GMT -7. The time now is 10:15 AM.


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