[Solved] Frustum, point inside frustum

#1

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
?

0 Likes

#2

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

1 Like

#3

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)

0 Likes

#4

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

0 Likes

#5

There’s a Frustum class already in the core, did you see it?

https://threejs.org/docs/#api/en/math/Frustum

0 Likes

#6

Indeed Frustum.containsPoint

0 Likes