Original Post
🔒 Locked
View Frustrum
Advertisement
Suppose your object''s coords in camera space are Cx,Cy,Cz and suppose you can put the object inside a sphere with radius Cr and center at Cx,Cy,Cz.
So, if (Cz+Cr)zFar, then the object''s outside of the near/far clipping planes.
If this test passes, then:
Suppose you make a projection of Cx,Cy,Cz to the screen getting some Sx,Sy, and you also calculate a projection of the radius Cr, such that it''s originated from Cx,Cy,Cz and is parallel to the projection plane, thus getting some Sr.
Then, if any of the four points (in screen space):
1. Sx-Sr,Sy-Sr
2. Sx+Sr,Sy-Sr
3. Sx+Sr,Sy+Sr
4. Sx-Sr,Sy+Sr
lies within the visible part of the screen, you can consider
the object to be roughly inside the viewing frustrum.
This is a rough method, but it''s very fast.
So, if (Cz+Cr)
If this test passes, then:
Suppose you make a projection of Cx,Cy,Cz to the screen getting some Sx,Sy, and you also calculate a projection of the radius Cr, such that it''s originated from Cx,Cy,Cz and is parallel to the projection plane, thus getting some Sr.
Then, if any of the four points (in screen space):
1. Sx-Sr,Sy-Sr
2. Sx+Sr,Sy-Sr
3. Sx+Sr,Sy+Sr
4. Sx-Sr,Sy+Sr
lies within the visible part of the screen, you can consider
the object to be roughly inside the viewing frustrum.
This is a rough method, but it''s very fast.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement