OK i'll do my best to explain this well
Part of my assignment this year is to make a game with a tank shooting at an alien - and it has to include some semi realistic physics.
this basically means that the projectile has to travel along a realistic path to hit the alien. The calculations easy enough, and it produces an X co-ordinate and a Y co-ordinate for a given time index
Code:
int getProjectileX(float timeIndex, float theta, float velocity)
{
return ((velocity*cos(theta*_PI_/180))*timeIndex);
}
int getProjectileY(float timeIndex, float theta, float velocity)
{
return (velocity*sin(theta*_PI_/180))*timeIndex-0.5*_GRAVITY_*(timeIndex*timeIndex);
}
nothing wrong with that, it produces accurate values as far as i can see.
the problem comes when drawing the projectile, as it draws it upside down cos of the computer having a retarded Y-axis
so my basic question would be how could I convert the co-ordinates so that they make the projectile display properly - ie the right way up. any ideas?
if you need stuff clarifying just reply here, i'm not the best at explaining my problems
ty
spud