2D vectors?
Blitz3D Forums/Blitz3D Programming/2D vectors?
| ||
If I have an object (2d) at coords OBJECTX,OBJECTY moving at any angle (0 - 360) at velocity `VEL`. How do I calculate the DELTAX,DELTAY value to add to OBJECTX,OBJECTY coords to allow me to move the object? cheers! |
| ||
Like so ... DELTAX# = VEL# * cos( Angle ) DELTAY# = VEL# * sin( Angle ) Stevie |
| ||
Thanks for the swift reply Steve.... This may sound odd but.... are pixels equal in size horizontally and vertically? If not ..... how would you compensate for any difference in size...for the formula you provided above? Many thanks! |
| ||
Most screen resolutions have a 4:3 aspect so each pixel should look square. They may not be technically but will to the human eye, at least my eyes ;) I wouldn't worry too much about it to be honest. Stevie |