away3d / away3d-core-fp10

Away3D engine for Flash Player 10
http://www.away3d.com
33 stars 11 forks source link

Couple of things with classifySphere #17

Open yonatan opened 12 years ago

yonatan commented 12 years ago

(and probably classifyRadius as well)

First, it returns INTERSECT immediately when it detects an intersection with any of the frustum planes, which seems wrong when the sphere is completely on the outside of some other frustum plane.

Second, there is a (literal) corner case, when a sphere intersects 3 of the frustum planes and is on the inside of the other 3, while still being completely outside the frustum volume. I have no idea how to fix that one.

Demo with a frustum extracted from the identity matrix (which I guess spans -1 and 1 on all axes): http://wonderfl.net/c/eNu4 Click the buttons for values demonstrating both issues.