bouncing a ball

This is a discussion on bouncing a ball within the C++ Programming forums, part of the General Programming Boards category; this is getting more difficult.... first i will bounce the ball ....then will try to solve my next problem....thanks for ...

  1. #16
    Registered User
    Join Date
    Aug 2009
    Posts
    20
    this is getting more difficult....
    first i will bounce the ball ....then will try to solve my next problem....thanks for ur help guys....

  2. #17
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Using doubles for positions would probably be a good idea; you'll likely find that an acceleration of 2 doesn't work too well, and you need 2.5, or something.
    A float is more than enough to represent the orientations.

    If this isn't for a physics class you can fake the ball bounce by taking the sin component of a circle and applying it to the ball. As the ball bounces you can slow it down, thus lowering the amplitude of the sine wave. It's fake but it works.

    To do true physics calculations it will require more than has been mentioned. For rotational effects you will need to calculate the first and second mass moment of inertia. You will need to compute the rotational inertia around the Cg at a time t. For a ball you would not need several point masses but you would need some type of mass calculation. You can use known volumes to approximate the MMOI's and a ball shape fits right into that.

    If this is going to be in 3D and the video card is an NVidia 8800 GT or better I would recommend you use the PhysX SDK to do the simulation as it will simplify it greatly.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to create a bouncing ball?
    By Swerve in forum C++ Programming
    Replies: 7
    Last Post: 09-12-2008, 03:41 AM
  2. The Old Bouncing Ball
    By bartybasher in forum Game Programming
    Replies: 3
    Last Post: 08-19-2003, 03:06 AM
  3. Bouncing Ball Algorithm
    By Stan100 in forum Game Programming
    Replies: 12
    Last Post: 04-06-2003, 07:36 PM
  4. Bouncing ball - help ??
    By Gugge in forum C Programming
    Replies: 7
    Last Post: 04-13-2002, 02:34 PM
  5. Bouncing ball
    By motocross95 in forum Game Programming
    Replies: 10
    Last Post: 01-07-2002, 08:25 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21