render2d/aspect2d collisions

I know it sounds strange, but it is for a special case. Does anyone know if it is possible to set up two 3d models in render2d, and have them collide with each other?

What I am trying to do is a bit complicated to explain, but I will give it a shot. I am taking data from a webcam (x and y coordinates) and I am assigning this data on the smiley egg file in order to move. I want then to create buttons on the screen, which when pressed my character will move forward/left/right. The buttons are pressed when the smiley which moves from the webcam data collides with them.

Now, I can not use normal dialogue buttons, because the mouse is not involved in the operation. So, I have to use 3d models and normal collisions, and came to the conlcution to parent both the smiley and the buttons on render2d, and make them collide. Unfortunately it doesnt seem to work.

Is everyone who read this very confused by now? If somebody can suggest a better way please do. If anyone who think can help and doesnt understand something please ask me to clarify.

Thank you very much.

Note : The webcam data is coming from an external software, connected to panda through tcp. I am not using panda3d webcam support (dont even know if it has :slight_smile:


There’s no reason that collisions should not work under render2d. However, you will need to use your own collision traverser (and not assign it to base.cTrav), and call traverser.traverse(render2d) yourself. The reason for this is that Panda by default calls base.cTrav.traverse(render), but traversing render won’t help you–you need to traverse render2d instead.

As to whether there’s a better way, well, there are certainly different ways to do it. I couldn’t tell you which way is better–that’s up to you.