Add a new Shape that represents a regular polygon and use it in meshes that use more complex shapes than triangles.
To do so, it will be necessary to implement an OBJ parser that reads a seq[Point3D] representing the nodes of the mesh and a seq[seq[int]] representing the sequence of shape indexes.
When we will check if a ray intersects the polygon we will break it in many triangles and iterate over them to find the hitted one.
Add a new Shape that represents a regular polygon and use it in meshes that use more complex shapes than triangles. To do so, it will be necessary to implement an OBJ parser that reads a
seq[Point3D]
representing the nodes of the mesh and aseq[seq[int]]
representing the sequence of shape indexes.When we will check if a ray intersects the polygon we will break it in many triangles and iterate over them to find the hitted one.