# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 6 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Balance of complex object :Posted: Thu Mar 05, 2009 1:22 pm

Joined: Thu Mar 05, 2009 12:37 pm
Posts: 5
We tried to build complex objects composed of small boxes (cube) like lego. The objects could be composed randomly. So we tried to use a compound object but the simulation it is not very stable and realist event with few boxes (125 boxes whose composed a big cube (5x5x5)).

Our questions are :
1- In a first time, we want to know why the following code doesn't work ?
2- In a second time... Is it the good way to do that if you want to have a object composed of 100000 boxes ? We don't need to have a complex collision detection, the only thing we want to know is if the balance object is stable or not.

Here an example of objects we want to build.
http://farm4.static.flickr.com/3083/2627011589_eda3c47fa8.jpg?v=1216068497

Top

 Post subject: Re: Balance of complex object :Posted: Thu Mar 05, 2009 7:47 pm

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3825
Location: California, USA
Quote:
1- In a first time, we want to know why the following code doesn't work ?

Interesting. You need to shift the child shapes, so that the world transform of the rigid body is aligned with the center of mass/principal axis of inertia.

There is a utility function in btCompoundShape to do this. Once you have this principal transform, there a 3 methods to shift the children:

1) create a recursive compound, with the inverse principal transform
2) shift the transform for each child in-place
3) create a new compound with the updated transform

See attached file, implementing all 3 methods. (3) is fastest to build and performs better then a recursive btCompoundShape.
Quote:
2- In a second time... Is it the good way to do that if you want to have a object composed of 100000 boxes ?

Should theoretically be possible. I just tried 5000 boxes, and the drawing becomes the bottleneck in the basic demo, so you need a better renderer.

Do you have any nice model you can share?
Thanks,
Erwin

Top

 Post subject: Re: Balance of complex object :Posted: Fri Mar 06, 2009 3:17 am

Joined: Thu Mar 05, 2009 12:37 pm
Posts: 5
The program will be open source. We will post results when we will generate nice models.

Top

 Post subject: Re: Balance of complex object :Posted: Mon Mar 09, 2009 6:37 pm

Joined: Thu Mar 05, 2009 12:37 pm
Posts: 5
Erwin Coumans wrote:
Quote:
1- In a first time, we want to know why the following code doesn't work ?

Interesting. You need to shift the child shapes, so that the world transform of the rigid body is aligned with the center of mass/principal axis of inertia.

There is a utility function in btCompoundShape to do this. Once you have this principal transform, there a 3 methods to shift the children:

1) create a recursive compound, with the inverse principal transform
2) shift the transform for each child in-place
3) create a new compound with the updated transform

See attached file, implementing all 3 methods. (3) is fastest to build and performs better then a recursive btCompoundShape.
Quote:
2- In a second time... Is it the good way to do that if you want to have a object composed of 100000 boxes ?

Should theoretically be possible. I just tried 5000 boxes, and the drawing becomes the bottleneck in the basic demo, so you need a better renderer.

Do you have any nice model you can share?
Thanks,
Erwin

Your code work fine with c++ but some students want to do it with jBullet and it looks like all the functionalities are not present in JBullet for the matrix.

Do you think there is another simpler way to do it ? Only the balance of the objects are important for us ?

Top

 Post subject: Re: Balance of complex object :Posted: Mon Mar 09, 2009 9:23 pm

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3825
Location: California, USA
Nicolas wrote:
Your code work fine with c++ but some students want to do it with jBullet and it looks like all the functionalities are not present in JBullet for the matrix.

Do you think there is another simpler way to do it ? Only the balance of the objects are important for us ?

The C++ solution BasicDemoCompound.zip attached earlier is the simplest and fastest way that I know.

JBullet is probably out-of-date, so it is best that those students switch over to using the C++ version, or port over the missing parts using the C++ version. For anything Java/JBullet related, contact information is on this website: http://jbullet.advel.cz/

Hope this helps,
Erwin

Top

 Post subject: Re: Balance of complex object :Posted: Mon Mar 09, 2009 9:28 pm

Joined: Thu Mar 05, 2009 12:37 pm
Posts: 5
Yes, I contacted the author of jbullet. I think we will find the problem.
I will let you know when we have some results.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 6 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], Google [Bot] and 11 guests

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

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities