Accelerated motion
Is there a simple solution to implement accelerated motion in Vizard?
Or do I have to use the normal vizact.move function and combine it with the formula "v = a · t + v"? Any ideas? |
Are you moving the viewpoint or some objects? Can you describe a bit the application you are creating?
|
Objects. I want to move an object (let's say a car) forward for a certain duration and with a certain average velocity. But with accelerated movement, not with constant velocity.
Example: vizact.move(0,0,6, velocity) --> In this function I can define the direction of movement and the duration of the movement, I can also specify a certain velocity. But now I want to accelerate this movement by let's say 1 m/s^2 (so that the velocity is rising for the specified amount of time) |
Moving an object.
Vizact.move(0,0,velocity,time) --> I can indicate a velocity and a duration of the movement. How to implement accelerated movement? |
You could apply a force using physics or register a function with vizact.onupdate where the object's position is set each frame.
|
I tried the following code. Do you see mistakes?
Code:
def Movement(): |
Never mind. Managed to do it with an even simpler solution. It is not entirely precise, but it works quite well. It isn't even shaking. Here is the code I used:
Code:
def Movement(): |
All times are GMT -7. The time now is 07:33 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC