How to create Collision Geometry in Blender

Could someone tell me how to create collision geometry in Blender? Or point me to a good tutorial? I haven’t been able to find anything with my searches.

Your search wasn’t very thorough, it seems. This topic is on the same page as this one.

Um, that topic doesn’t answer my question. And I did read it before I posted.

Am I wrong to think that you have to define what the collision geometry looks like within blender before you export it to egg? After going through the Ball-In-Maze file, I was under the impression that you created different collision polygons, and named them in blender before you exported them. Like the maze floor, and the maze holes.

I’m still not clear on what your question is. Collision geometry is just like any other geometry, it’s just processed differently, and how it’s processed is determined by its tags which are indirectly supported by Chicken via the ObjectType syntax. Please read the other topic if you want to know more about what those are.

I don’t know the blender detailled how to.
But basically collision geometry are standard models that are exported with a specific tag into the egg file.
This tag make them available for collision detection and “invisible”.

You get a big gain in collision performance if your collision geometry is more simple that your “visible” geometry.

Basically what i do in a modeler is to
create my visible geometry.
duplicate it
reduce polygon count (with keeping the shape as much as possible)
scale to be just bigger the visible geometry
Make an egg.

Then i edit the egg and set the tag.

But i think in Blender you don’t need to set the tag manually, you can use the provided interface.

This needs some “elucidation” :smiley:

Ok, so I have to edit the egg file to set up the collision stuff.

I also need to set up the simple geometry in blender. And then somehow tell the egg file to use that for the collisions, instead of the more complicated visible stuff.

So, how do I do that?

Is there a tutorial out there that explains step by step how to go from complicated model, to simplified model, to editing the egg file?

Or could someone write one?

I am honestly surprised that there isn’t anything like that in the manual. Or if there is, it is not obvious.

I’m still messing around with this stuff. Once i understand this fully i can try making a tutorial.

The most common game scene setup is to have a big static scene with actors. For each model (animated or not) we need a normal model to be rendered and a special model for collision. If you save these into the same egg file or not or if you explicitly name the collision node is up to you as long as you know how to associate them in your game.

In Blender if you duplicate an object, decmate it and tag it with “ObjectType=barrier” (in the Game panel) as the other thread mentioned it will be processed into a collision node when it is loaded. You then have a collision node you can use in the game. I usually name my objects like this: “table” and “table-c” to distinguish the collision from the render model.

The trick where we edit the egg file and add the line { Polyset keep descend } is a little more complex and the process above is done for you automatically but you won’t get an optimized collision node only a copy of the original mesh with the same name so it’s better not to do it this way and tweak your own collision mesh.

Thanks! I hope you are able to write that tutorial. :smiley:

It looks like the { Polyset keep descend } trick will work for me right now. I don’t have any complicated models at all. Pretty much just simple cubes.

There’s a game panel in Blender? I don’t see one listed under the window type menu.

I do not think that it is under any ‘menu’ Look in the buttons window header. Look for the purple sideways facing smiley face. When you hover over it the tooltip should say ‘logic’. Officially its call the "logic window’

I have the collision wall in place operating as it should, but it is visible as a white wall in front of the wall I want seen.

OK, so I have a mesh of a wall and it has no material on it. I place it just inside the actual wall I don’t want players to walk through. I go to the logic panel in Blender 2.49b and AddProperty: change float value to string, type Collide into the name field and Polyset descend into the field beside it. I chicken export it and open it in Panda3d 1.7.0. And everything works perfectly, bouncing the player off the wall as it should. But the collider wall is visible.

I wonder if there is a bug somewhere. I have been playing around to right the problem and ended up typing “Polyset hide descend” into the logic panel of the wall collision mesh (Blender). Although I got a don’t know what “hide” is warning from Panda, for some reason collision meshes are now invisible … which is what I wanted. In fact I have even removed “hide” and the collision meshes are still exporting and loading as invisible.