WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-29-2010, 12:47 PM
flip321 flip321 is offline
Member
 
Join Date: Nov 2010
Posts: 4
Question Moving objects smoothly

Hey,

does anyone know how to make a movement of an object smooth? I mean that the acceleration and breaking process is smooth and gives it a more realistic feeling?

Thanks a lot
flip321
Reply With Quote
  #2  
Old 12-01-2010, 09:29 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Can you provide more detail about what you are trying to do?
Reply With Quote
  #3  
Old 12-08-2010, 05:29 AM
flip321 flip321 is offline
Member
 
Join Date: Nov 2010
Posts: 4
Of course:
Let's say I want to move an imported 3D-object from it's position to the center of the stage/screen whatever with the coordinates [0,0,0]. The skript works, but in order to make it look more realistic in a physical way, I want the beginning of the movement progress to start slower as well as the ending of the movement.
In other words I want the speed of the movement to increase in the beginning and decrease in the end, and NOT to have a constant movement speed over the whole time.

Here's a part of the script I'm using right now:

Quote:
def show_moviepreviews():
moveToStage = vizact.moveTo([0, 0, 0],time=1)
movie_icon.addAction(moveToStage)

Thanks a lot,
Philipp
Reply With Quote
  #4  
Old 12-09-2010, 12:32 AM
Huib Huib is offline
Member
 
Join Date: Nov 2010
Posts: 10
If you have some t, going linearly from 0.0 to 1.0, first transform it before passing it to setPosition or whatever move function.

Example for slow in, slow out:

new_t = (1.0 - math.cos(math.pi * t)) * 0.5

bonus for fast in, slow out:

new_t = math.sin(((1.0 - t) ** 2 + 1) * math.pi / 2.0) ** 2

these new_t values will lie between 0.0 and 1.0 as well.
Reply With Quote
  #5  
Old 02-24-2011, 03:45 AM
flip321 flip321 is offline
Member
 
Join Date: Nov 2010
Posts: 4
hm, could you add this into my example skript? I can't really picture who I should integrate it...
Isn't there any easier way like giving an extra parameter along with the "move function" in order to get the same results?

But thanks a lot in advance!!! I appreciate it!
Reply With Quote
  #6  
Old 12-21-2011, 02:01 AM
Huib Huib is offline
Member
 
Join Date: Nov 2010
Posts: 10
Better approach: see the help for interpolation modes, for instance:

Code:
def show_moviepreviews():
    moveToStage = vizact.moveTo([0, 0, 0], time=1, interpolate=vizact.easeInOut)	
    movie_icon.addAction(moveToStage)
Reply With Quote
Reply


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
Moving objects together imperialkat Vizard 2 02-17-2010 12:43 PM
Semi-circle array containing target and distractor objects ptjt255 Vizard 3 08-04-2009 03:09 AM
Lightwave objects rotation problem hosier Vizard 6 02-13-2009 12:04 PM
Moving multiple objects with ppt durf Vizard 1 02-10-2009 03:03 PM
Could not find plugin to load objects... halley Vizard 1 05-30-2006 11:01 AM


All times are GMT -7. The time now is 04:29 PM.


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