WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-28-2009, 04:11 PM
vijaykiran vijaykiran is offline
Member
 
Join Date: Sep 2009
Posts: 13
Unable to perform 360 rotation using vizact.spinto

Hello,

I am trying to make an object perform a single spin action for 360 degrees followed by a forward motion. The following piece of code doesn't seem to help and the object just stays put.

Code:
model = viz.add('object.ive')
spinToYaw = vizact.spinto([0,1,0, 360], 50)
moveForward = vizact.move([0,0,4], 5)

model.addAction( spinToYaw )
model.addAction( moveForward )
I am however able to get up to 180 degrees of rotation with:
Code:
spinToYaw = vizact.spinto([0,1,0, 180], 50)

Any more than 180 degrees spins the object in the opposite direction:
Code:
spinToYaw = vizact.spinto([0,1,0, 181], 50)

To perform a 360 degree rotation, I thought i could get lucky if I run yaw actions two times using:
Code:
spinToYaw = vizact.spinto([0,1,0, 180], 50)
...
model.addAction( spinToYaw )
model.addAction( spinToYaw )
model.addAction( moveForward )
The above did nothing but rotate the model by 180 degrees and then immediately moved forward as defined in
Code:
moveForward
action. The second call to
Code:
model.addAction( spinToYaw )
did not make any difference.

On the other hand, if I have a different axis for spinto as in the code below:
Code:
spinToYaw = vizact.spinto([0,1,0, 180], 50)
spinToRoll = vizact.spinto([0,0,1, 180], 50)
...
model.addAction( spinToYaw )
model.addAction( spinToRoll )
model.addAction( moveForward )
So, here are my two questions:

1) I get a 180 degree yaw, followed by 180 degree roll and then forward movement. If this logic works, then shouldn't two 180 degree yaws work as a 360 degree rotation ?

2) If there is a reason why two 180 degree yaws will not equal to a 360 degree rotation, what do I need to do to obtain just one single 360 degree rotation followed by another action. I do not want to use viz.FOREVER because it will keep on spinning the model.


Thanks,
Vijay.
Reply With Quote
  #2  
Old 09-28-2009, 04:26 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The vizact.spinto action will take the shortest path to reach the target orientation. If you are turning 360 degrees, then the shortest path is to do nothing.

Instead, use the vizact.spin action and calculate the duration and speed so the end result is 360 degrees ( speed * duration = 360 ).
Reply With Quote
  #3  
Old 09-29-2009, 08:39 AM
vijaykiran vijaykiran is offline
Member
 
Join Date: Sep 2009
Posts: 13
Thanks farshizzo. That was what I was looking for.
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
tracking head rotation orientation VAmanda Vizard 3 09-21-2005 04:57 PM
Weird lagging/choppiness when avatars perform actions vjonshih Vizard 8 11-30-2004 04:08 PM
getting absolute rotation tavaksai Vizard 1 08-03-2004 01:40 PM


All times are GMT -7. The time now is 04:39 AM.


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