• Advertisement
Sign in to follow this  

Projectile help

This topic is 2688 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement