![]() |
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 |
Can you provide more detail about what you are trying to do?
|
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:
Thanks a lot, Philipp |
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. |
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! |
Better approach: see the help for interpolation modes, for instance:
Code:
def show_moviepreviews(): |
All times are GMT -7. The time now is 11:58 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC