Iterating triangles

Hi!

I need to be able to know if a model’s triangles lie within a cube. I’ve seen the information found in this thread:

https://discourse.panda3d.org/viewtopic.php?t=306&highlight=iterateegg

But that code allows to iterate through all egg’s vertices without considering the triangles that the vertices form.

So my question is the following: Is there a way to iterate through all the triangles that form an .egg, in order to check if the triangle’s vertices are within my cube?

Thanks!

Yes, just iterate through the children of EggData until you come to an EggPolygon, then iterate through the vertices of EggPolygon. The Reference should show you the specific information you need for this. You could also examine examples such as egg-octree.

David

Great! Thanks David!