Show differencesHistory of post edits
Posted 28 December 2012 - 07:04 AM
Posted 28 December 2012 - 07:03 AM
Posted 28 December 2012 - 07:02 AM
Good opportunity for optimizing the intersection algorithm itself is to calculate an axis-aligned bounding box of the mesh in advance; it is then easy to determine whether or not it is even possible that the ray would intersect any of the triangles. Ray-AABB intersection is very fast. The D3DX function does not do this, as it may be expensive to calculate the bounding box itself, and it cannot assume that a givel mesh is unchanged between the calls to it.