Jump to content
  • Advertisement
Sign in to follow this  
Odiee

Projectile theory

This topic is 2614 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

Hello.

I I'm at the position in my project where I need to do projectile calculations (bullets, bombs etc.) for a dual stick shooter. (player shoots at the direction of mouse position)
Previously I was using the Bresenham's line algorithm for fast calculations of points from A to B. Where a would just draw pixels or some bitmap.
But as I'm now working in OpenGL and with floating points this is no longer an option. I figured I would need starting point A(x,y,z) and Direction point B.
And I would need to calculate all the points from A through B until timer ends or some other event (collision etc.) And put a bitmap at each point.
But this is where I'm stuck. I don't know what to use, or weather I'm even right on the theory part.

Is there someplace I could learn about this topic?

Share this post


Link to post
Share on other sites
Advertisement
Without taking air resistance into account, projectile trajectories follow parabolas.

You have the starting direction and speed, with that you create a vector with X and Y speed components. The X reamains constant and you apply the gravity acceleration to the Y.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!