Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9274867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:27:13+00:00 2026-06-18T16:27:13+00:00

I’m programming a game (JAVA) and i would like to add some gravity in.

  • 0

I’m programming a game (JAVA) and i would like to add some gravity in. I tried to find a formula or someting like this and there is so different way to do it. I’m looking for a formula who can simulate a realistique gravity and make some rebound when the object is touching the floor. Sorry for my bad english.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:27:15+00:00Added an answer on June 18, 2026 at 4:27 pm

    Near Earth’s surface, the gravitational acceleration of all falling bodies is constant (ignoring air resistance). The formula xf = x0 + v0*t + (1/2)*g*t^2 will give you the final position xf given the initial position x0, the initial (vertical) velocity v0 and the time t that the object has been falling. g is a constant that technically depends a bit on your elevation and other factors, but is around 9.81 m/s.

    To do rebound, you’ll need first to do some collision detection. When you detect a collision, you’ll need to compute the vector normal to the surface (easy if your surface is a horizontal plane) and then “reflect” (sort of) your velocity vector through that vector (if the normal vector is pointing directly upwards, i.e., you’re bouncing off a flat surface, this amounts to inverting the velocity v). Note that, to make this realistic, you should probably apply some damping after a bounce: in addition to reflecting the velocity vector, you’ll also want to scale it down (depending on how it reflected after the bounce, this could involve reductions in either or both components).

    To actually simulate such a scenario, you can use a variety of techniques: either pre-compute a list of points and then run an animation through them, or you could simulate all of this using Euler’s method or some other numeric quadrature technique (trapezoid rule, Runge Kutta, etc.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.