# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Calculating collision shape from a .obj modelPosted: Thu Nov 08, 2012 12:12 pm

Joined: Thu Nov 08, 2012 12:05 pm
Posts: 1
I'm developing a 3D game where you play is a robot on wheels and your character is affected by physics continuously. So, if you are pushed, you fall over. If you roll into a wall, you'll bounce off. I think I have this part done - I'll just have a constant force pushing your character while the wheels are moving and touching the floor.

However, how would I get the collision shape for your character? The model is loaded from an .obj model file. I have access to every triangle. I'm completely new to physics, not sure how this stuff works. Would I just get the bounding box and use a cube collision box? What about other shapes your character might collide with too? How would I match the collision shape to the shape of the model?

Sorry if what I'm saying isn't very clear - I am rushing this post as I have to go in a second and would like an answer for when I get home. Thanks, Jishaxe.

Top

 Post subject: Re: Calculating collision shape from a .obj modelPosted: Sun Nov 11, 2012 6:28 am

Joined: Sat Aug 18, 2012 2:20 am
Posts: 19
Location: Chennai, India
You can use convexHull shape which can directly take the vertex and index lists of your model and build a hull shape. This should be the easiest was to do it. However, if you are not looking into that much details, you can use compound shape. Compound shape is a bunch of shapes joined together.

Top

 Post subject: Re: Calculating collision shape from a .obj modelPosted: Tue Nov 13, 2012 8:27 am

Joined: Fri Jun 24, 2011 8:53 am
Posts: 149
Without seeing the model it's hard to tell whatever a convex hull will be sufficient.
I'm fairly sure there's an obj->bullet serialization example in the 2.78 SDK (and probably in all others). It produces a polysoup so you're strongly encouraged in using a lower-detail LOD for the model.
Of course this takes for granted the model is somewhat monolithic in nature. If this isn't the case you'll have to model the various constraints.
Compound shapes are another possibility but I'm unsure about their use, I think I read somewhere they didn't work as expected on GPU-accelerated broadphase (but I guess that's an outdated statement now).

Top

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

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot] and 19 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