Something I think would help me and many other noobs-

If somebody could place an example of a small environment with the collision objects and a codehow to check for those?

I understand what is happening academically in roaming ralph’s example- but practically I do not know how to build a environment like that in Blender.

the collision rays measures the distance of the terrain from the zero-line and then you move ralph up and donw the z axis accordingly.

What confuses me is how that blender file was made and how the objects in the blender file are notated. Nothing big just a blend file so I can see how it is done. Or a point to a tutorial that explains that.

The world.egg in Roaming Ralph is very long and I get lost trying to visualize what is happening and trying to tell the textures apart.

JB Skaggs

ALright I fixed my egg file so I can walk on terrain

  <Collide> { Polyset keep descend }

was missing from my Group Terrain{

code on my map.

BUT I still have no idea how to do this in Blender. The tutorials I see are for Torque, Oblivion, and Elder Scrolls are those techniques going to work in Panda?

Jb SKaggs

I usually duplicate the scene model, but with a lower resolution. Then, still in blender, I set the tag “ObjectType” to “barrier”. That will make something an invisible collision solid (ObjectType “barrier” is the same as Collide “Polyset descend”, I believe).

The advantage of that approach is also that you can use Chicken’s octreefy option (this optimizes collision geometry making collisions faster).

You’ll also need a model with just 1 vertex somewhere, called start_point. Roaming ralph searches the model for a node called like that and extracts its position to find out where to place the model.

Chicken also supports the ‘Collide’ tag, in which you can just write ‘Polyset Keep Descend’ if you want - same consequences, just a different way of doing it.

For marking the player position you can use an empty rather than a single vertex mesh though - it exports empties fine. You can also use a normal mesh, say a mesh of the player for the players start and give it the tag ‘ForceEmpty’ to make it be exported as an empty - this is convenient for visualisation and accurate positioning.

But go read the manual - its all in there.

Just to clarify - lethe means the Chicken manual.

JB, here I packed up a couple of samples for you related to this topic - in one folder there are samples on how to target with the mouse objects in 3D space and in the other folder there is a room with a ladder where to roam a big panda, in with you’ll find how to use a cool panda3d API class to simplify avatar movements into several surfaces using separate collision surfaces and there is a blender source too, that I guess will help you to understand how to settle up a scene to use for such a task - I hope you’ll find that useful but come back here if you got other Qs

Oh wow, thanks. :smiley:

When I make some headway then I go and see what others are doing it makes my head feel like cheese.

Everything is so different from 2d that I get going then hit a roadblock that hindsight is always so obvious.

I’ll get this understood soon.

JB Skaggs

Alright I am starting to get this collision thing.

Now my question is very simple:

Why doesn’t this if statement work: (there is only 1 object in this array)

    if    len(self.mana)>0:
            lenVector = self.ralph.getPos() - self.mana[0].getPos()
        if    len(self.mana)>0:
            if lenVector.length()<2:

It removes the the object but then next loop the if statement does not see that the array has fell to zero and tries to run the block but of course I get error that the array is empty.

JB SKaggs

if self.mana is a list of NodePath object, your code shall be:

if   len(self.mana)>0:
     lenVector = self.ralph.getPos() - self.mana[0].getPos()
     if lenVector.length()<2:
           del self.mana[0]

I see now!

JB Skaggs