Collision meshes

Pls explain me all the steps to create collision meshes from 3ds max to include code in .egg files & Code for collision in .py file.


I don’t use Max, but this is something that I’d be interested in knowing too. In the Roaming Ralph example it shows putting the tag: { Polyset keep descend } in the egg file, but it doesn’t seem too clear on what to do from there. Do you treat it as colliding against visible geometry, or a collision solid?

Also, is setting that tag better than using a CollisionPolygon?

Setting that tag means the egg loader will create CollisionPolygons automatically based on the geometry in the egg file. This is all that it means. This is usually a much easier way to create a mesh of CollisionPolygons than by creating them all in code, of course.

In other respects, the resulting CollisionPolygons can be used as described in the manual on collisions. Do you have a more specific question?


We created a Virtual Room(in 3ds Max) using the BASIC Shape - BOX for Walls and floor. Then we Exported the max file to egg file.

Then we opened up the resulting Walls.egg file in notepad and
pasted following code for every group in the scene.
{ Polyset keep descend }

Then we used this file as environment and Ralph (The actor in Roaming Ralph example) as Actor.
But we were not able to see the Collision Rays and visual representation of collisions occuring.
We have used the code that shows collision rays and the visual representation of Collision.

Please suggest what could be the reason for this.

I think the Roaming Ralph code makes particular assumptions about the names of the collision nodes that are in the scene, and searches for these nodes by name in order to enable collisions. So if your node has a different name than the original name, it won’t work.


But we haven’t yet written code to handle collision.
Its just that we want to first assure that the rays touch each other.

This we have seen using some of of our other Environment and ralph(the actor).

Could there be something that is not letting us see the collision rays?

Collision rays, and any other collision solids, are hidden by default. If you want to see them, you have to get a handle to them and call


I just noticed that the resulting polyset doesn’t correctly transformed. Is the transform for each node not taken into account ? I saw there is vtx 2 node call in the src, but I haven’t dug deeper. What is it suppose to do then ?
And the collision ray doesn’t showed up, emm, since 1.4.x.


Thanks to you all.
Just got to see the Collision rays By Removing the
tag from the MyEnvironment.egg. :smiley: