Hi to all,
I tried to do cannon projectiles for a game.I know the destination point where the cannon should land and also have a option of selecting the speed it travels say from 80 Kph to 100 Kph.I need to know the angle.How can i find the angle (theta) for the projectile .MY Launching position is higher than the landing position.Please help me fix this.Thanks in Advance
Projectile help
is your projectile physically simulated with velocity and gravity?
If so... does it have to be? Or does it only have to LOOK like it's physically simulated?
If it only has to look like it, you could fake it.
Basically, over time, interpolate the x position from the source x position to the destination x position.
also over time, interpolate the y position from the source y position to the destination y position - but add sin(PercentDone * Pi) * Height to the y position.
That will make it look like it's arcing up from the source and then back down onto the destination.
If you need to actually physically simulate the projectile, you can solve the problem mathematically.
If you need help with that, post your code so we can see the equation(s) you are using.
If so... does it have to be? Or does it only have to LOOK like it's physically simulated?
If it only has to look like it, you could fake it.
Basically, over time, interpolate the x position from the source x position to the destination x position.
also over time, interpolate the y position from the source y position to the destination y position - but add sin(PercentDone * Pi) * Height to the y position.
That will make it look like it's arcing up from the source and then back down onto the destination.
If you need to actually physically simulate the projectile, you can solve the problem mathematically.
If you need help with that, post your code so we can see the equation(s) you are using.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement