#Understanding Projectile Motion and solving Projectile Motion problems

66 messages · Page 1 of 1 (latest)

sick shoal
#

Do you guys know how projectile motion works? And how to solve stuff like inital velocity, time, etc.
Checked online and watched vids but still really confused. Basically, I'm coding a projectile where when the player shoots it the projectile will travel in an projectile motion arc to the target. Wherever you move the player, the bullet will still travel in that arc to the target.

Apparently, to figure this out I'm supposed to calculate the inital velocity of the bullet, but I'm really confused on the math and the formulas online. Moreover, I think I'm confused either the overall concept. I pretty much forgot all my math from highschool and I never took highschool physics so maybe that's it.

I was seeing if someone can help me out with this. Thank you!

quaint kindleBOT
neon field
sick shoal
#

Oh interesting

craggy thistle
#

Projectile motion goes on the concept that since diagonal motion (motion in 2D) is complicated, we simplify our study by looking at it in two directions: upward-downward ( y axis) and left-right (x axis).
In the y direction, theres a constant acceleration (acceleration due to gravity) g = -10m/s², minus meaning it faces downwards. So the equations of motion for accelerated motion help us do calculations for y direction. In the x direction, there is no acceleration. Thus it goes by the extremely simple formula distance = speed/time.

GROUND TO GROUND projectile:
Now lets look at the concerned equations and how we get them. Say, time of flight; i.e. how long the projectile is in air. We know that at the end of the projectile motion the y cooredinate will once again be 0 (when it reaches ground). But we started from the ground, i.e. y = 0. Hence, there has been no real displacement in the y direction. From the second equation of motion: s = ut + 1/2(at²), where s is displacement, we can put the values of s as 0, initial velocity (u) as whatever the initial velocity IN THE Y DIRECTION was, the acceleration (a) as -g, and solve for time (t). This yields t = 2u/g. Similarly, say you want maximum height. At the maximum height, the projectile at that instant is neither moving upwards nor downards. Thus by the third equation of motion (s = v² - u² / 2a) we can put values of v (final velocity) as 0, intial velocity IN THE Y DIRECTION be u, say, and acceleration (a) is -g. This gives us maximum height as u²/2g.
This was just an example. Things get complicated when we do projectiles on inclined planes, where the standard approach is to shift your point of view to the frame of the inclined plane, and assume downwars acceleration g to have split into x and y components (in the frame of the inclined plane)

#

The x and y axis are basically independent of each other as they are at 90°. Without air resistance, it is interesting to realise that the speed of the projectile in the x direction (left-right) never actually changes. It is simply the y direction which undergoes the changes, bye virtue of gravitational acceleration g.

#

We go under the assumption that projectile motion ends inmediately once it touches the ground. But for the sake of it, if the ball were to rebound, no change would be seen in its motion in the x direction.

sick shoal
craggy thistle
#

Concept is easy enough once you understand it

sick shoal
#

Ah

#

Yeah

#

It's been years since I've done math

craggy thistle
#

For code projects though just google the formulae and put them in, easier than going through a 30 min high school physics lecture

sick shoal
#

I heard this is an easy problem, like my projectile motion thing

#

Ah

#

Even then once you learn the concept it's pretty solve and code?

craggy thistle
#

Once the concepts in the rest of the path is pretty clear

#

I imagine your game uses some form of projectile

sick shoal
#

Ah yeah it does

craggy thistle
#

Then you're gonna have to account for air resistance (no use of going into those calculations just use some random acceleration whatever seems intuitively correct(

#

Cause then you're integrating and logarithms and stuff

sick shoal
#

True

craggy thistle
sick shoal
#

I think I'd probably start with gravity though

#

Lol yeah

craggy thistle
#

Good luck on your project man

#

Or woman

sick shoal
#

Thank you I mean if I have to learn it I'll learn it, you know?

craggy thistle
#

*Someone got really offended on the gender once)

craggy thistle
sick shoal
#

I heard that my problem is used in highschool lectures and stuff

#

Yeah

craggy thistle
#

Ye if you look at the absolute chimpanzees in my high school you wont doubt yourself ever again

sick shoal
#

Lol

#

I think I need to brush up on some khan for a bit

sick shoal
craggy thistle
sick shoal
#

Ah I see what you mean

#

Even then it all doesn't sound too difficult to solve

#

Like I found formulas about it but I couldn't understand them lol

craggy thistle
#

Do uk equations of motion?

sick shoal
#

Oof I don't, unfortunately

#

That's what I have to learn

craggy thistle
#

Yeah i dont know how necessary physics is for you but if you want to understand kinematics (the physics of motion) then thats the place you want to start
The derivations from there on are simple observations. I observe that at the end of the projectile, for ground to ground projectiles, it reaches the same height it started off from. So no displacement was done in the vertical direction

neon field
#

There was a good gdc talk I came across a while ago talking about physics in games, i’ll see if I can find it because it would probably help fill some gaps

sick shoal
#

And I believe projectile motion is talked about there

#

I heard from another person that's basically all you need to solve it

craggy thistle
#

Good luck! (Just watch youtube tutorials)

sick shoal
#

Thank you lol

craggy thistle
#

As for trigonometry O O F

sick shoal
#

I'm probably overcomplicated it only because it's new, you know?

craggy thistle
#

I suck at trigonometric manipulations

sick shoal
#

Ah yeah I mean if it's gets tough I'll reach out to the peeps here

craggy thistle
sick shoal
#

Yeah

#

And it looks like that might be the case with my problem lol

#

I think

neon field
craggy thistle
#

I say quantum numbers someone who hasnt done highschool chemistry thinks its something entirely different, but once you understand it its like much more simple

neon field
#

Give it a watch

sick shoal
#

Because I remember making a bullet spread for a project and people said it would be extremely complicated and advanced, but I learned the concepts and I was able to whip it up in 10 mins

craggy thistle
#

Damn you gotta remember to flex on them dont forget

sick shoal
#

Lol

#

I literally completed it and was like, "that's it?: