WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-05-2009, 03:18 PM
vijaykiran vijaykiran is offline
Member
 
Join Date: Sep 2009
Posts: 13
Trouble with adding actions

Hello,

I have been grappling with adding two animate actions and I am unable to get the animation I intended.

I am trying to make a car model move forward and turn right after a certain length. I used one of the samples to do it:

Code:
import viz
viz.go()
viz.add('tut_ground.wrl')
wheel = viz.add('mini.osgx')  

viz.move(0,0,-10)
viz.clearcolor(viz.SKYBLUE) 

moveForward = vizact.move(0, 0, 2,1) 
turnRight = vizact.spin(0,1,0,90,1) 


moveInSquare = vizact.sequence(moveForward, turnRight, 2) 

wheel.addAction(moveInSquare)
The animation is fine with this code except the car doesn't look like it's turning
correctly. The turning is about the center of the car model. I figured I need to add a
Code:
 wheel.center(x,y,z)
to make the turn look realistic. So, I changed the code to this:

Code:
import viz
viz.go()
viz.add('tut_ground.wrl')
wheel = viz.add('mini.osgx')  
wheel.center(0.5,0,-0.5) # Added this piece of code

viz.move(0,0,-10)
viz.clearcolor(viz.SKYBLUE) 

moveForward = vizact.move(0, 0, 2,1) 
turnRight = vizact.spin(0,1,0,90,1) 


moveInSquare = vizact.sequence(moveForward, turnRight, 4) 

wheel.addAction(moveInSquare)
Now, the car turns sort of okay, but as soon as it turns right it zooms too fast compared to its first forward movement. It didn't make sense to me how it works. The
Code:
wheel.center(x,y,z)
should affect rotations but not translations. I am unsure why translations are affected. Besides, I am not sure what (x,y,z) in center() mean. Is it absolute coordinates or relative to the object?

Is there something I am missing? Any suggestions would be extremely helpful.

Thanks,
Vijay.

Last edited by vijaykiran; 10-05-2009 at 03:19 PM. Reason: Forgot to enable email notification
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
trouble tracking multiple lights Vkathrynr Precision Position Tracker (PPT) 2 08-26-2009 12:07 PM
adding more than 1 action for avatar animation slider control yak Vizard 0 07-21-2009 11:22 AM
Trouble transitioning from one vizard DBurks2818 Vizard 3 04-28-2009 02:46 PM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 08:48 AM
Weird lagging/choppiness when avatars perform actions vjonshih Vizard 8 11-30-2004 04:08 PM


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


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