Roaming Ralph Map Question

I am familar with Python, I use Linux Panda3D but very new at it. Just started the “Roaming Ralph” tutorial and need question answered.

I create a new in direct.x format, then changed these lines;

self.environ = loader.loadModel("models/the big city.x") #line number 63

self.ralph.setPos(36,0,0) #line number 75 so Ralph is not inside wall.

it shows in demo. But Ralph does not move. What is the problem?

Thanks for your help,

The terrain in RR has some collision data, since you say you are loading from .x then your model can’t have that. You’d be best of converting to egg (x2egg ships with panda) and add to a top most group { Polyset keep descend }
I think RR also has a ‘starting position’ set in the terrain model, but yoi csn just as well put ralphStartPos = Point3(x,y,z)

Ok I understand this, but since Panda loads .x I would like to use .x format.

The .egg format is not widely used by many 3D modeling programs. I have none in stock. I also understand both .egg and .x are text files very same by nature. I want to continue with the common .x format. Is there another method of collision to be used?

I removed collision statement on line #231-232 to reflect this;

  if (len(entries)>0) and (entries[0].getIntoNode().getName() == "terrain"):
        #    self.ralph.setPos(startpos)

Now ralph moves but can move through walls as well.

Thank you once again,

The egg format is Panda specific… so it has panda-specific stuff (like collisions). You can’t use the .x format for collisions because the .x format has no way of storing such data. Just like you can’t use a jpeg file to store animations.

It is possible to generate geometry for collision from a .x file, but it’s way, way harder then just converting the .x file to .egg and adding one extra line.

If you really, really, REALLY want to do it the hard way then you’d have to write your own file parser to construct a CollisionPolygon for every polygon in your .x file or get those from the geom after loading it into panda. Either way, I wouldn’t even know where to start with such a task.

…then again, you could take a look at Bullet for collisions. Bullet has no connection to panda build-in collisions and has some functions to generate collision shapes from loaded models ( … ion_Shapes). Meshes loaded from .egg, .bam or .x would work just the same.

Thank you for taking your time to formulate a logical reply. My associate has proposed that we could convert to .egg format but once done they would not be reverted back. So they would need to be perfected in the .x format, then converted to the .egg format using the x2egg conversion. My only concern is with the lack of 3D tools able to edit an .egg file? From my research on the subject, this seems to be restricted to 3DS Max or Maya correct? Other programs such as Blender offer plugins with an exporter but no import feature. Most common users lack the funding to own a legal copy of commercial 3D editing software. Is anyone working on an egg mesh editor that you are aware of at this time? The project I am working on would require the user to have some ability to edit the mesh.