News for hackers. Stuff that matters.
Re:“When are we going to use this in our everyday life?” (2017) by tenebrisalietum on Tuesday October 04, 2022 @06:22PM (#33087921)
Basically it's two things:

1. answering the question "how do we get the next x" for a function x=y.

If x=y, then if you increase x, you also increase y, so dx/dy=1. Figuring out dx/dy is fun when dealing with things like 3x^2+5x+7=y.

But take the game of Pong, for example. A simple Pong game has a ball and the direction of the ball can be controlled by two variables - horizonal velocity (H) and vertical velocity (V).

Each frame, you take the ball's X and Y and add H and V to it, to move the ball. When the ball collides with something, just multiply by -1 (to flip the sign) to reverse the ball.

If you divide V by something like 0.0001 each frame, you will implement gravity.

Want the ball to have a gravity or other "pull" that results in it hitting a point in a specific number of frames? Well ... someone who knew what they were doing would know what to do. That's all I got.

2. If you have a few points for x=y, you should be able to figure out dx/dy somehow. I think that's called integrals.

Re:“When are we going to use this in our everyday life?” (2017) by itishappy on Tuesday October 04, 2022 @06:42PM (#33088131)
Minor correction:

> If you divide V by something like 0.0001 each frame, you will implement gravity.

You will implement air resistance. Air resistance is proportional to the velocity, gravity is a constant offset.

V(n+1) = V(n) - drag * V(n) - gravity

Re:“When are we going to use this in our everyday life?” (2017) by treis on Tuesday October 04, 2022 @06:30PM (#33087997)
>If you divide V by something like 0.0001 each frame, you will implement gravity.

That'd be a wild ride.

Re:“When are we going to use this in our everyday life?” (2017) by behringer on Tuesday October 04, 2022 @07:02PM (#33088335)
Oh sure, that's simple enough. How about gravity over a sphere in 3 dimensions? How about a custom physics and collision engine? How about some portals? How about some non linear spaces?

Games get incredibly complicated very quickly.