Jump to content

  • Log In with Google      Sign In   
  • Create Account


Creating a Ball [Video]


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Medo3337   Members   -  Reputation: 665

Like
0Likes
Like

Posted 30 October 2012 - 05:36 PM

I am using Bullet Physics and trying to create a ball that will be behaving like the ball in the following game:


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?

Sponsor:

#2 Bacterius   Crossbones+   -  Reputation: 8157

Like
1Likes
Like

Posted 31 October 2012 - 12:00 AM

ball rotating while moving

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)

the ball will be always moving straight depending on where the camera is looking it

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, 31 October 2012 - 04:56 AM.

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#3 Medo3337   Members   -  Reputation: 665

Like
0Likes
Like

Posted 31 October 2012 - 08:13 AM

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, 31 October 2012 - 08:35 AM.


#4 jjd   Crossbones+   -  Reputation: 2066

Like
0Likes
Like

Posted 31 October 2012 - 11:43 AM

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.


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

-Josh

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet


#5 Medo3337   Members   -  Reputation: 665

Like
0Likes
Like

Posted 31 October 2012 - 01:54 PM

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, 31 October 2012 - 01:58 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS