#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
Are you moving the viewpoint or some objects? Can you describe a bit the application you are creating?
|
#3
|
|||
|
|||
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) |
#4
|
|||
|
|||
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? |
#5
|
|||
|
|||
You could apply a force using physics or register a function with vizact.onupdate where the object's position is set each frame.
|
#6
|
|||
|
|||
I tried the following code. Do you see mistakes?
Code:
def Movement(): Object.setPosition(0,0,0) v0 = 0 t = 0 a = 1 while t < time: s = v0*t + 0.5*a*t**2 vizact.ontimer2(0.1,0,Object.setPosition,0,0,s) t = t+0.1 |
#7
|
|||
|
|||
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(): Object.setPosition(0,0,0) v0 = 0 t = 0 a = 5 while t < time: s = v0*t + 0.5*a*t**2 Object.setPosition(0,0,s) t = t+0.0168 #Adjustement based on processing speed of computer (lazy amateur workaround) |
Tags |
acceleration, motion, movement, velocity, vizact |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mismatched Translation Between Real Motion and Display | amir | Vizard | 2 | 05-31-2018 07:17 AM |
Motion Builder Without Live Characters? | lafortuj | Precision Position Tracker (PPT) | 2 | 07-30-2015 05:21 PM |
PPT Mocap and Motion Builder Connection Problem | hxphan | Precision Position Tracker (PPT) | 3 | 02-22-2011 11:01 AM |
an object in motion does not stay in motion? | driechers | Vizard | 2 | 11-09-2010 03:51 PM |
Motion Capture & CyberGloves | EnvisMJ | Vizard | 1 | 10-01-2009 04:21 PM |