May 20, 2012 at 12:19am UTC
Hello all, trying to learn how to use vector math and velocity position while rendering objects. The problem that I am having is that I do not understand the syntex when trying to use Equations of motions.
Vector2D Physics::dX( double dt )
{
Vector2D dX ;
Scalar delta_t = (Scalar) dt ;
Vector2D initial_velocity = velocity ;
//Then
//Update velocity
//(ii)
//Use the updated velocity and initial velocity to find dx
//(ii)
//Use dx to update position.
return dX ;
}
Last edited on May 20, 2012 at 12:58am UTC
May 20, 2012 at 2:39am UTC
This is what i have so far
Vector2D Physics::dX( double dt )
{
Vector2D dX ;
Scalar delta_t = (Scalar) dt ;
Vector2D initial_velocity = velocity ;
Vector2D update_velocity = initial_velocity+position;
dX = update_velocity + initial_velocity * delta_t;
position = position + dX;
Vector2D final_velocity = initial_velocity + gravity * delta_t;
return dX ;
}
Last edited on May 20, 2012 at 5:59am UTC
May 20, 2012 at 8:24pm UTC
Why is no one answering plz explain??/
heres what i have since this morning still cannot get velocity to work
Vector2D Physics::dX( double dt )
{
Vector2D dX ;
Scalar delta_t = (Scalar) dt ;
Vector2D initial_velocity = velocity ;
Vector2D final_velocity = velocity + ((acceleration + gravity) * delta_t) ;
dX = velocity * delta_t +( .5 *(acceleration + gravity) * (delta_t * delta_t));
dX += position;
initial_velocity = final_velocity + (position * delta_t);
return dX ;
}
May 20, 2012 at 8:54pm UTC
Perhaps this webpage will assist you: http://mathworld.wolfram.com/VelocityVector.html
Wazzak