Clipping/Masking Question

Forgive me for not knowing the exact terminolgy, perhaps that’s why I have been unable to find an answer.

I’ve been programming with Panda since the Summer and I have only recently found out how to make my own models.

What I have is a room model, which is four enclosed walls and I have a door model.

My problem is that I want to make it that I can ‘attach’ the door to the wall and make it that when the door is open, it masks the points of where the door is open to make it that the door is the only object visible in that area. Currently, I have it that when the door is open, I see the door open, but in the doorframe the wall is still visible.

It seems to be something within reason to expect there is someway I am not thinking of to make the portion of the wall that coincides with my door invisible.

Additional information: I have gotten the collisions to work properly, I made a collision node that goes through the part of the door and when the player is colliding with this node, it ignores the other collsion parameters and he/she can go through the wall in that spot. It is only a graphical/visual issue I am dealing with.

If I understand you correctly, you want to cut a hole in the wall where the doorframe is, so that there is no wall visible within the doorframe?

There is no easy way to do this automatically. There are hard ways to do it, for instance using a stencil buffer, or perhaps some sneaky tricks with the depth buffer; but probably the easiest way to do it is to actually cut a hole in the wall there, using whatever modeling tool you used to construct the room geometry.


Aha I thought as much. Thanks for responding. The point of the game I’m making is that the house is customizable and you can put the door on different spots in the wall. I guess this limits the felxabilty of the customization. Instead, I’m going to use Blender to split the faces of the wall into the size of the door and make them indidual parts that I can use the removeNode function to make invisible when the door is snapped to that part of the wall.

Sounds like a good plan. Be sure to call flattenStrong() on at least the entire room node after you have constructed it, to combine as many individual pieces together as possible.


But if I understood his plan correctly, he wants to choose a wall segment at runtime and use removeNode on it to make a hole in the wall at that point. Won’t the flattenStrong make that removeNode impossible, or else make it fail? Or did you mean he should make a new room node and call flattenStrong on it, each time the user changes where the door is located?

Right, of course flattenStrong() makes any further changes impossible, so you have to wait to call this until after you are done making changes.

If you want to be able to later modify a door position, you have to either avoid calling flattenStrong() altogether, or you have to keep an offscreen copy of the original wall before you called flattenStrong() on it (and copy it back in to make new changes).