Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: physic simulation bouncing ball

  1. #1
    Newbie Newbie
    Join Date
    May 2017
    Posts
    2

    bouncing ball

    Hello,
    if I want to make the ball fall on flat surface and then bounce, do I have to create the flat surface?

  2. #2
    Newbie Newbie
    Join Date
    May 2017
    Posts
    2

    physic simulation bouncing ball

    Hello, I want to make the ball falling at flat surface and then bounce until it stop just like in the real life. I'm using opengl glut in codeblock. I'm still the beginner. What I understand, I need create the class for ball and flat surface. Then I need to implement the physics formula into the coding. my problem is, I don't know how to code the formula. how to set the maxHeight of ball, the speed and then when the ball at the surface, it will bounce until finally stop due to friction and energy loss.

  3. #3
    Intern Contributor
    Join Date
    Dec 2016
    Posts
    54
    If you're talking about doing this in 3D, maybe if you're not sure how to do this, try 2D first?

    One thing with the Physics that I can tell you from the top of my head, is that the Acceleration will be constant (gravity). So speed will increase (acceleration) at a constant rate. Usually this is added every frame.

    You may have inspired me to try this in 2D today. Thanks and good job. Best of luck in all your OpenGL Endeavors, also, I have a YouTube channel for OpenGL Tutorials, check out the link below:

    https://www.youtube.com/channel/UCzx...ELz5h1dfCdkdfg

    Thanks,
    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •