• Create Account

### #ActualK_J_M

Posted 10 September 2012 - 09:30 PM

It seems to me you are looking at the issue with regards to world coordinates.

If you look at the issue with regards to local car coordinates then each wheel has 0 longtitude velocity and (N) Lateral velocity if the car is spinning on the spot.

Marco Monsters car physics tutorial performs the world to local coordinates transform by rotating the linear world velocities by the yaw angle of the car / wheel.

s = Sin(yaw_angle)
c = Cos(yaw_angle)
local_lateral_velocity = (world_x_velocity * c) + (world_z_velocity * s)
local_longitude_velocity = (world_x_velocity * -s) + (world_z_velocity * c)

And to transform back from local to world coordinates. ( Note the sign for the sine command is reversed, which reverses the direction of rotation )

world_x_linear_velocity = (local_lateral_velocity * c) + (local_longitude_velocity * -s)
world_z_linear_velocity = (local_lateral_velocity *s) + (local_longitude_velocity * c)

But in regards to a stationary car spinning on it's axis the lateral wheel velocity is derived from the car angular velocity.

### #4K_J_M

Posted 10 September 2012 - 07:55 PM

It seems to me you are looking at the issue with regards to world coordinates.

If you look at the issue with regards to local car coordinates then each wheel has 0 longtitude velocity and (N) Lateral velocity if the car is spinning on the spot.

Marco Monsters car physics tutorial performs the world to local coordinates transform by rotating the linear world velocities by the yaw angle of the car / wheel.

s = Sin(yaw_angle)
c = Cos(yaw_angle)
local_lateral_velocity = (world_x_velocity * c) + (world_z_velocity * s)
local_longitude_velocity = (world_x_velocity * -s) + (world_z_velocity * c)

And to transform back from local to world coordinates. ( Note the sign for the sine command is reversed, which reverses the direction of rotation )

world_x_linear_velocity = (local_lateral_velocity * c) + (local_longitude_velocity * -s)
world_z_linear_velocity = (local_lateral_velocity *s) + (local_longitude_velocity * c)

### #3K_J_M

Posted 10 September 2012 - 07:54 PM

It seems to me you are looking at the issue with regards to world coordinates.

If you look at the issue with regards to local car coordinates then each wheel has 0 longtitude velocity and (N) Lateral velocity if the car is spinning on the spot.

Marco Monsters car physics tutorial performs the world to local coordinates transform by rotating the linear world velocities by the yaw angle of the car / wheel.

s = Sin(yaw_angle)
c = Cos(yaw_angle)
lateral_velocity = (world_x_velocity * c) + (world_z_velocity * s)
longitude_velocity = (world_x_velocity * -s) + (world_z_velocity * c)

And to transform back from local to world coordinates. ( Note the sign for the sine command is reversed, which reverses the direction of rotation )

world_x_linear_velocity = (lateral_velocity * c) + (longitude_velocity * -s)
world_z_linear_velocity = (lateral_velocity *s) + (longitude_velocity * c)

### #2K_J_M

Posted 10 September 2012 - 07:53 PM

It seems to me you are looking at the issue with regards to world coordinates.

If you look at the issue with regards to local car coordinates then each wheel has 0 longtitude velocity and (N) Lateral velocity if the car is spinning on the spot.

Marco Monsters car physics tutorial performs the world to local coordinates transform by rotating the linear world velocities by the yaw angle of the car / wheel.

s = Sin(yaw_angle)
c = Cos(yaw_angle)
lateral_velocity = (world_x_velocity * c) + (world_z_velocity * s)
longitude_velocity = (world_x_velocity * -s) + (world_z_velocity * c)

And to transform back from local to world coordinates. ( Note the sign for the sine command is reversed, which reverses the direction of rotation )

world_x_linear_velocity = (car_lateral_velocity * c) + (car_longitude_velocity * -s)
world_z_linear_velocity = (car_lateral_velocity *s) + (car_longitude_velocity * c)

### #1K_J_M

Posted 10 September 2012 - 07:50 PM

It seems to me you are looking at the issue with regards to world coordinates.

If you look at the issue with regards to local car coordinates then each wheel has 0 longtitude velocity and (N) Lateral velocity if the car is spinning on the spot.

Marco Monsters car physics tutorial performs the transform by rotating the linear world velocities by the yaw angle of the car / wheel.

s = Sin(yaw_angle)
c = Cos(yaw_angle)
lateral_velocity = (world_x_velocity * c) + (world_z_velocity * s)
longitude_velocity = (world_x_velocity * -s) + (world_z_velocity * c)

And to transform back from local to world coordinates. ( Note the sign for the sine command is reversed, which reverses the direction of rotation )

world_x_linear_velocity = (car_lateral_velocity * c) + (car_longitude_velocity * -s)
world_z_linear_velocity = (car_lateral_velocity *s) + (car_longitude_velocity * c)

PARTNERS