simple Question about movement
hi,
i'am fail on a simple question (shame on me)
i have an object with a position of
0.0, 7.49, 1.8
i like to move this object over a time (2 seconds) to the new position
0.0, 48.0, 71.0
first i get the directionvector an normalize this
my animatefunction looks like this
anyone can helps me ??
thanks
i'am fail on a simple question (shame on me)
i have an object with a position of
0.0, 7.49, 1.8
i like to move this object over a time (2 seconds) to the new position
0.0, 48.0, 71.0
first i get the directionvector an normalize this
my animatefunction looks like this
Code:
(float)update :(float)timeElapsed
{
move the object with the normalized vector but how fast ???
}
anyone can helps me ??
thanks
On the y axis you want to travel 487.49 in 2 seconds, so the speed on the y axis is (487.49)/2.
So to update the y position:
y+=(487.49)/2* timeElapsed
Same for x and z.
You can also do it with the normalized vector but you end up doing more calculations than you need
So to update the y position:
y+=(487.49)/2* timeElapsed
Same for x and z.
You can also do it with the normalized vector but you end up doing more calculations than you need
Â©hâ‚¬ck Ã¸ut Âµy stuÆ’Æ’ Ã¥t ragdollsoft.com
New game in development Rubber Ninjas  Mac Games Downloads
You would like to move from A to B in t where t ranged from 0 to 2.
let u = t/2, so now u ranged from 0 to 1.
P(t) will be a function which gives you the position at time t,
You start at A, and away from A toward B, so:
P(t) = A + (BA)*u
P(t) = A + (BA)*(t/2)
So for example,
P(t).x = A.x + (B.x  A.x)*(t/2)
let u = t/2, so now u ranged from 0 to 1.
P(t) will be a function which gives you the position at time t,
You start at A, and away from A toward B, so:
P(t) = A + (BA)*u
P(t) = A + (BA)*(t/2)
So for example,
P(t).x = A.x + (B.x  A.x)*(t/2)
Sir, e^iÏ€ + 1 = 0, hence God exists; reply!
thanks, that works :)
Possibly Related Threads...
Thread:  Author  Replies:  Views:  Last Post  
glutWarpPointer lag and fps movement  Ropeburn  3  8,226 
Jan 18, 2011 09:47 PM Last Post: OneSadCookie 

3d Space Sensing movement?  wonza  6  4,278 
Dec 19, 2008 08:19 PM Last Post: wyrmmage 

AI/Movement  wonza  6  5,050 
Nov 26, 2008 10:23 AM Last Post: wonza 

simple question (private)  imaumac  9  4,930 
Oct 21, 2008 09:37 PM Last Post: imaumac 

Registering window movement  Muriac  12  5,764 
May 12, 2007 12:55 PM Last Post: impeacefull 