Skip to main content
6 votes

How do you make a camera look at a box and ensure all of it is visible?

Take every point (vertex), project them into screen space (basically multiply them with the projection * view * model matrix). After you got this, take every point ...
Bálint's user avatar
  • 14.9k
5 votes
Accepted

Why are clipping planes... plane?

They're planar because that's how the math works out. Classic OpenGL and Direct3D use projection matrices to transform the scene between "world space" and "screen space". "...
Mark's user avatar
  • 353
5 votes

Finding the normals of the planes of a View Frustum

Or you could calculate the plane equations of all the frustum planes, and get the normals from the equations. A plane equation has the form: Ax + By + Cz + D = 0 (A, B, C) represents the plane ...
Hermetix's user avatar
  • 507
5 votes
Accepted

Finding the normals of the planes of a View Frustum

It becomes much clearer if you draw it from a top-down perspective: The normal on the right is simply the direction vector of the camera rotated by -90°-fovX/2 around the y axis and the one of the ...
Bálint's user avatar
  • 14.9k
3 votes

What is the near plane equation in NDC?

In NDC, the clipping planes are a box that goes from -1 to 1. Near plane equation is therefore \$Z+1=0\$ and far plane \$Z-1=0\$
Michael M.'s user avatar
2 votes

How do you handle large triangles with frustum?

Elimination of large triangles isn't as simple as the vertices aren't on screen then the triangle can't be seen. For an accurate frustum cull, the only valid elimination scenario for your data (...
ErnieDingo's user avatar
  • 1,150
2 votes
Accepted

Drawn frustum does not match with glm::perspective

Looks like that by luck I found the solution to the problem. I really don't like the glm documentation, was my understanding that glm doc was intentionally skinny since it matches corresponding glsl ...
user1777995's user avatar
2 votes
Accepted

Can I get world-space z-near-plane vertices from projection matrix + z-near distance?

Thanks @DMGregory for the pointer in the comments. I'm constructing a fullscreen quad at (x, y, -1, 1) in NDC. Notice z = -1 is ...
kaoD's user avatar
  • 1,935
2 votes
Accepted

Having some trouble with my frustum checking code

Assuming the "inside" of a plane is the opposite side of the plane.normal, the function IsSphereInsidePlane correctly determines if the sphere is completely inside ...
Turms's user avatar
  • 408
2 votes
Accepted

OpenGL frustum extraction

In openTK you need to transpose matrices to make it work. Green lines are frustum in world space. ...
some rand's user avatar
  • 118
2 votes

Unity how to make raycaster test only against collider in frustum

Unity definitely has some spatial partitions of their own under the hood of all their physics and raycasting systems, it's very unlikely Unity's actually doing a collision check with every single ...
Charly's user avatar
  • 742
1 vote

Cubic Voxel Game, Calculate What Chunks are in the Player's View, using 3D chunks?

I later looked up an implementation of this algorithm so I could do it on another thread, I didn't even know it existed and it is actually fairly simple! My implementation still uses a Unity function <...
Tristan367's user avatar
1 vote
Accepted

Frustum Culling bug in program

I solved this problem. I added an extra sphere - test. Although the method has errors, but it solves my problem completely. Since this is an editor, it is appropriate here. But there will be a ...
Range's user avatar
  • 159
1 vote

How to get a camera's frustum information?

One way would be to construct the projection matrix from your info, invert it, and send the 8 device-normalized coordinates of the corners through it. In OpenGL (and I assume Vulkan), those would be: ...
user1118321's user avatar
  • 2,632
1 vote

How to clip cut-off using different frustrum than that of original camera? How to cut plane by pyramid shape?

For a simple way of doing it, you’ll need two things: First, you’re looking for the Sutherland-Hodgman Clipping algorithm, or some other type of clipping algorithm. Sutherland-Hodgman is very easy to ...
Jon's user avatar
  • 534
1 vote
Accepted

Problem with Frustum Culling Right-Handed(LookAtRH GLM)

Well, at the end it was a mistake in my game data, after update the game data everything worked perfectly, but also did some changes, instead of keep geometric approach algorithm for get all six ...
Isaías's user avatar
  • 19
1 vote

Frustum culling takes ages c++

Main ways to speed up frustum culling (and collision in general): simplified bounding: you have AABBs (check) fast collision functions: looks like you are doing this (in progress) spatial ...
Shmoopy's user avatar
  • 69

Only top scored, non community-wiki answers of a minimum length are eligible