[SOLVED] texture support in Bullet Physics...

Post Reply
LastBlow
Posts: 18
Joined: Mon Jul 11, 2016 10:36 am
Location: SAN DIEGO

[SOLVED] texture support in Bullet Physics...

Post by LastBlow »

Hi, first post here... What would be the best way to apply a texture to a soft body using Bullet Physics, say on an ellipsoid? In particular, how to make the black lines on the ellipsoid disappear? More generally, are textures supported in Bullet and how? Thank you in advance for showing me the way. :D
Last edited by LastBlow on Sun Nov 12, 2017 3:16 am, edited 1 time in total.
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: texture support in Bullet Physics...

Post by benelot »

Hi LastBlow,

How do you visualize your Bullet simulated softbody? Bullet is a physics engine only, so it does not have any visualization capabilities (what you see in the Bullet example browser is OpenGL, not Bullet Physics). The only thing related to visualization it has is the bullet debug drawer. It can be implemented to draw the physics world within any kind of graphics engine, but for this purpose you need a separate graphics engine such as Ogre3D, Irrlicht, pure OpenGL etc. You probably already use such an engine as you think about adding textures.

The basic procedure to visualize a cube (for simplicity) in a graphics engine looks like this:

Create a graphical cube within your graphics engine.
Write a simple update loop for your graphics, within which you step your physics and then update the graphical cube position and orientation with the bullet cube's position and orientation.

To texturize your cube, you should then check out how to do this in your graphics engine. Furthermore, if you experience strange physics (cube hovering above ground etc.) you should implement the debug drawer, which draws you the actual size of the cube. For some graphics engines, the units of the dimensions are different, therefore a 1x1x1 cube in your graphics engine might be bigger/smaller than a 1x1x1 cube in bullet. Then you might need a scaling factor (meaning if a 0.5x0.5x0.5 graphics cube is the same size as a 1x1x1 bullet cube, you need to scale every object in your graphics engine with 0.5 for each dimension.)

Tell me if this helps or if you need anything else.
LastBlow
Posts: 18
Joined: Mon Jul 11, 2016 10:36 am
Location: SAN DIEGO

Re: texture support in Bullet Physics...

Post by LastBlow »

Oh, I sure asked this (totally newbie) question more than an year ago...

Thank you for taking the time to answer, it all make sense now. In fact, I use OpenGL and Blender for visualization.
Will go ahead and mark the question solved.
Post Reply