Hi All,

We have just improved our selection algorithm.

Before we did:

- project all the triangles on screen
- check for pickbox intersection with 2D triangles and for mutual vertex inside (pickbox vertex inside the triangle and triangle vertex inside the pickbox)

The limitation:

In perspective mode, triangles with a vertex behind the viewer got weird 2D coordinates invalidanting the complete selection operation.

New algorithm:

- Get a 3D frustum composed by 6 planes
- Check first if the object bounding sphere intersects the frustum
- In case of intersection, loop over object’s triangles to check if the triangles sides cross the frustum
- If no intersection is found, check for ray-triangle intersection for all 4 frustum sides (near to far)

The problem:

Speed. The new algorithm is accurate but slow. Intersection checks for triangles sides and furstum planes and ray-triangle intersections are slow processing a mesh of 50.000 triangles.

Is there any way to speed up the new algorithm?

Thanks,

Alberto