Sign in to follow this  

Projectile help

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this