• Advertisement
Sign in to follow this  

Creating a Ball [Video]

This topic is 1905 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using Bullet Physics and trying to create a ball that will be behaving like the ball in the following game:
http://www.youtube.com/watch?v=LgLJHExN1PI

I need to know how to do it using Bullet Physics, this include (ball rotating while moving, the ball will be always moving straight depending on where the camera is looking it, etc...

Any idea or sample code will be much appreciated.

How do I get started?

Share this post


Link to post
Share on other sites
Advertisement
[quote name='Medo3337' timestamp='1351640219' post='4995624']
ball rotating while moving
[/quote]
I'm not sure but I don't think the ball is actually rotating physics-wise. Sure, it has a rotating marble texture, but I don't think rotational motion is being considered at all in the physics simulation (for good reason - it's very difficult to control a "real" ball with spin, if you've ever played table tennis for instance you'll know that)

[quote name='Medo3337' timestamp='1351640219' post='4995624']
the ball will be always moving straight depending on where the camera is looking it
[/quote]
Velocity is already independent of camera position, it's your game engine's job to ensure the camera doesn't somehow influence the ball's velocity - Bullet doesn't even know what a camera is. Edited by Bacterius

Share this post


Link to post
Share on other sites
In physics, when a ball move, it must be rotating as well, so I guess that should be done using Bullet Physics since no ball can be moving without rotating.

I have tried to use body->setLinearVelocity() and I see it's rotating now, but I can't get the ball to behave like the ball in the video. Edited by Medo3337

Share this post


Link to post
Share on other sites
[quote name='Medo3337' timestamp='1351692798' post='4995828']
In physics, when a ball move, it must be rotating as well, so I guess that should be done using Bullet Physics since no ball can be moving without rotating.

I have tried to use body->setLinearVelocity() and I see it's rotating now, but I can't get the ball to behave like the ball in the video.
[/quote]

The latest version of bullet (v2.81) has a rolling friction demo that should be useful.

-Josh

Share this post


Link to post
Share on other sites
Okay, I think I have accomplished a good part, now I am looking to make the ball move forward according to where the camera is looking at, I am also looking to update the camera position to make it follow the ball all the time (exactly as you see in the video).

How do I update body->setLinearVelocity() to make the ball move according to where the camera is look at?
How do I update the camera position x, y, z to make it following the ball? which values I should be setting during the rendering process? Edited by Medo3337

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement