Tutorials beyond Hello World

Please don't post Bullet support questions here, use the above forums instead.
Hachaso
Posts: 6
Joined: Fri Feb 04, 2011 2:31 pm

Tutorials beyond Hello World

Post by Hachaso »

Hi!

I haven't really understood how to add the physics properties to my objects.
If I have an OpenGL object that I render on the screen. Could be an airplane.
What do I need to do to add some physics to it?

Are there any good tutorials on this?
The examples are quite advanced.
Maybe some good book?

Please point me in the right direction.

Thanks
mattrix
Posts: 10
Joined: Tue Feb 01, 2011 1:49 pm

Re: Tutorials beyond Hello World

Post by mattrix »

Hachaso wrote:Hi!

I haven't really understood how to add the physics properties to my objects.
If I have an OpenGL object that I render on the screen. Could be an airplane.
What do I need to do to add some physics to it?

Are there any good tutorials on this?
The examples are quite advanced.
Maybe some good book?

Please point me in the right direction.

Thanks
I suggest you to start by reading a couple of times the User Manual:
http://bulletphysics.com/ftp/pub/test/p ... Manual.pdf

Then try to understand each step of the Hello World Tutorial:
http://bulletphysics.org/mediawiki-1.5. ... ello_World

using the Reference:
http://bulletphysics.com/Bullet/BulletFull/

Unfortunately it seems there is no other easy way.

Regards,
M.
lulzfish
Posts: 43
Joined: Mon Jan 03, 2011 4:26 pm

Re: Tutorials beyond Hello World

Post by lulzfish »

Don't think of it as adding physics to a graphics object.

Think of it as creating a physics world, and then pasting a graphics object on top of its corresponding physics object.

There is usually a pretty wide separation between how something reacts physically and how it looks, and it's really the physics (or character animation) that drive the application, with the graphics just sort of following along.
Hachaso
Posts: 6
Joined: Fri Feb 04, 2011 2:31 pm

Re: Tutorials beyond Hello World

Post by Hachaso »

So the way Bullet works is that you create the World, att physics to it.. then you draw your objects inside the World?

So if I want to draw my own objects I have to still use:

Code: Select all

btCollisionShape* groundShape = new btBoxShape(btVector3(btScalar(50.),btScalar(50.),btScalar(50.)));

btCollisionShape* groundShape = new btStaticPlaneShape(btVector3(0,1,0),50);
m_collisionShapes.push_back(groundShape);
Replacing the btBoxShape with my own object for instance ??
lulzfish
Posts: 43
Joined: Mon Jan 03, 2011 4:26 pm

Re: Tutorials beyond Hello World

Post by lulzfish »

No, the Bullet world is separate from the graphics world.

You have two worlds, one for physics, one for graphics. Every frame you update the graphics objects based on their corresponding physics objects. Then you draw the graphics objects.

Bullet has nothing at all to do with drawing, it just tells you where your objects are and what they're doing.
Hachaso
Posts: 6
Joined: Fri Feb 04, 2011 2:31 pm

Re: Tutorials beyond Hello World

Post by Hachaso »

Ok, let me see if I understood this correctly.

So I have my vertex points, give them to Bullet, for every frame, Bullet gives me new vertex positions, I use those vertices to draw my object on the screen?
Something like that?

Bullet is only used to give me new coordinates so the objects follows the physics worlds rules. Those new coordinates are then used so I can draw my object in my own world..