31.03.2015, 19:04
Anyway, to add something more useable to this:
Let's face this problem mathematically. Imagine 2 coordinate systems - 1. The static coords (sa-mp coordinates x y z) and 2. the dynamic coordinates (relative to the car - dX dY dZ)
If you then calculate the shadow of the static system on the dynamic one (proportion in dX, dY and dZ direction), you could multiply it with this value.
So
- get the x y z velocity of the car
- transfere the x y and z coordinates into dX dY and dZ
- multiply dX dY dZ with "speed"
e.g.
(x, y, z) = (1, 1, 0)
would be something like (1/sqrt(2) + 1/sqrt(2), 1/sqrt(2) + 1/sqrt(2), 0) = (dX, dY, dZ) [I guess at least]
for an angle offset of 45 degrees (you can express this with cos and sin)
I hope that this helps a bit more^^
Let's face this problem mathematically. Imagine 2 coordinate systems - 1. The static coords (sa-mp coordinates x y z) and 2. the dynamic coordinates (relative to the car - dX dY dZ)
If you then calculate the shadow of the static system on the dynamic one (proportion in dX, dY and dZ direction), you could multiply it with this value.
So
- get the x y z velocity of the car
- transfere the x y and z coordinates into dX dY and dZ
- multiply dX dY dZ with "speed"
e.g.
(x, y, z) = (1, 1, 0)
would be something like (1/sqrt(2) + 1/sqrt(2), 1/sqrt(2) + 1/sqrt(2), 0) = (dX, dY, dZ) [I guess at least]
for an angle offset of 45 degrees (you can express this with cos and sin)
I hope that this helps a bit more^^