Skip to main content
GameDev.net gamedev.net
🔒 Locked

Projectile theory

Started by Odiee Oct 13, 2011 at 9:45 AM 0 replies 3.1k views
Original Post
Odiee
Odiee
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?
klefebz
klefebz
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.
I don't play MMOs because I would become addicted

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.