Page 1 of 1

RigidBodyFromObjExample

Posted: Mon Jul 10, 2017 6:28 am
by bullseyetroll
I'm very very new to all the 3D stuffs,

Currently, I'm testing the RigidBodyFromObjExample in the tutorial

the imported obj "teddy bear" should be falling,

but it appears that it remains "floating" in the air.

I've tried different obj files, and only "sphere8.obj" falls as expected.

Is there something I should adjust when import vertex into btConvexHullShape ?

Thx

Re: RigidBodyFromObjExample

Posted: Mon Jul 10, 2017 4:26 pm
by drleviathan
bullseyetroll, there appears to be a bug in the code when loading the teddy.obj file. The first thing I noticed was that the inertia tensor of the shape was bad (<0.00966241, 1.25677e+14, 1.25677e+14>). When I examined the shape in more detail I found what appeared to be corrupt data: 9576 vertices, some with very bad values. The teddy.obj file is human readable and doesn't even have 9576 lines, so the vertex data parsed from that file is clearly wrong.

Maybe you should be using the stable version: Bullet-2.86?

Re: RigidBodyFromObjExample

Posted: Tue Jul 11, 2017 1:42 am
by bullseyetroll
Thx for the reply,

I'm currently using bullet3-2.86.1 from https://github.com/bulletphysics/bullet3/releases

so maybe i should fire an issue on github :lol:

Re: RigidBodyFromObjExample

Posted: Tue Jul 11, 2017 3:37 pm
by drleviathan
I downloaded the Bullet3-2.86.1 from that link and built on linux in 32-bit mode: the teddy bear moves and collides just fine. My previous attempt from the tip of bulletphysics/master was in 64-bit mode, so I rebuilt Bullet3-2.86.1 in 64-bit and reproduced the bug: the teddy bear was static.

Yes, I think a github issues should be filed specifying that it is the 64-bit mode that is broken.

Re: RigidBodyFromObjExample

Posted: Wed Jul 12, 2017 2:06 am
by bullseyetroll
I delete everything and compile it with 64bit again ... and magically it works.
I'm wondering how to reproduce this bug..