WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-29-2016, 02:19 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
In order to run the code, I changed the model to the piazza. However, I didn't notice a coordinate offset from one trial to another. If you have viewpoint collision enabled and depending on the stepsize, the viewpoint can get bumped up on collisions with the scene. If you want to wait until the path is finished playing before doing something else, wait for a path end event:

Code:
import viz															
import viztask													

viz.go()

startPos = [-6.4,1.4,-8]
view = viz.MainView 
view.eyeheight(1.4)

maze1 = viz.add('piazza.osgb')

pathMaze1 = viz.addAnimationPath()
pathMaze1.addControlPoint(2, pos=startPos,euler=(0,0,0),scale=(2,2,2))
pathMaze1.addControlPoint(4, pos=startPos,euler=(90,0,0),scale=(2,2,2))
pathMaze1.addControlPoint(6, pos=(0,1.4,-8),euler=(0,0,0),scale=(2,2,2))
pathMaze1.addControlPoint(8, pos=(0,1.4,5),euler=(0,0,0),scale=(2,2,2))
pathMaze1.addEventAtEnd('maze_end')

link = viz.link(pathMaze1,view)

def trials():
	
	for x in range(4):
		
		print 'trial',x
		pathMaze1.play()
		yield viztask.waitPathEvent(pathMaze1, 'maze_end')
		yield viztask.waitKeyDown([viz.KEY_LEFT,viz.KEY_RIGHT])
		pathMaze1.reset()
	
viztask.schedule( trials() )
Reply With Quote
 

Tags
animation path


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
animation path problem - coordinates not resetting jelly Vizard 7 04-26-2016 10:45 AM


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


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