Hello!
Is it possible to use THREE.js to set FRUSTUM (like aztec pyramide)
(ABCD EFGH) : Vector3
And determine if point P:Vector3 inside or outside of this FRUSTUM
?
Hello!
Is it possible to use THREE.js to set FRUSTUM (like aztec pyramide)
(ABCD EFGH) : Vector3
And determine if point P:Vector3 inside or outside of this FRUSTUM
?
Found
by frustum points get planes, and get distance from opposite planes to this point
if sighns of distances are different - point between planes and inside frustum
For posterity: you check the side of a frustum plane. Frustum plane is defined by:
normal::Vector3 //plane normal vector
distance::number //offset of the plane along the normal vector
You check that the point is “above” each of the planes that define the frustum (top, bottom, left, right, far, near)
Almost. now i represent frustum as 5 planes and one point (start point SP) - cross of 4 sideedges
Check is point and SP on the other sides of the first plane and between 4 other planes
As normal vectors of the opposite planes has the opposite direction - distances from inner point to the opposite planes must have the same signs
There’s a Frustum class already in the core, did you see it?
Indeed Frustum.containsPoint