Physics Simulation Forum


All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Mar 15, 2017 9:40 pm 

Joined: Tue Sep 13, 2016 3:43 pm
Posts: 6
Hey, I'm trying to edit an example in the Bullet ExampleBrowser, but I want to set the color for each individual rigid body. My efforts are in vain, however, as none of my objects are rendering. I would like to give an example of what I am doing for the ground texture and let me know if this is sound.

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

btTransform groundTransform;
btScalar mass(0.);
btRigidBody* ground = createRigidBody(mass, groundTransform, groundShape);

m_guiHelper->createRigidBodyGraphicsObject(ground, btVector4(0, 1, 0, 1));

I'm assuming after creating the rigid body, all I have to do is add that last line which I thought would render the object with the specified color (in this case green).
Thanks for any input.

PostPosted: Sun Mar 26, 2017 12:08 pm 

Joined: Sat Jul 04, 2015 10:33 am
Posts: 349
Location: Bern, Switzerland
You can not set the color of the individual objects in the example browser. This is not part of the API. If you need this, you have to move out of the example browser. The example browser only shows what you can do with the physics engine. It has minimal graphics to make things visual.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 16 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group