I have been having an issue with frustum culling, specifically culling planes (not to be confused with the frustum planes). I am using JOML in Java with the FrustumIntersection class, and using the projection matrix * the view matrix for the matrix (for the projection view matrix). The way I am finding the minimum and maximums for the AABB is by simply iterating through the vertices and multiplying that by the transformation matrix in JOML. Although this issue doesn't appear to happen with any meshes other than planes, here is a gif of what is happening:

As you can see, the plane is being culled when the camera moves on a certain axis when looking straight down (it should not be doing that), but only on that axis. Any answer that could hint me in the right direction would be great.


UPDATE: The issue was fixed, it was just a simple problem with the way I was storing the vertices, getting the axises intertwined.


All frustum intersection test methods in FrustumIntersection expect the input vectors to be defined in the local coordinate frame defined by the supplied matrix. So, if your matrix is a model-view-projection matrix, then you need to give the frustum intersection test methods (such as testAab()) coordinates in model-space. Since you surely know the model-space coordinates of your plane - which is probably something like (-1, 0, -1)..(+1, 0, +1) - then the minimum and maximum of that is exactly the minimum and maximum of the axis-aligned box you need to input into FrustumIntersection.testAab(), for example. Like I said, this assumes that you have your model-space transformations encoded inside the MVP matrix you also give to FrustumIntersection.

| improve this answer | |
  • \$\begingroup\$ The problem still persists. I have also tried calculating the eight points from the minimum and maximum values, transforming them (with the matrix), then recalculating the min and max to no avail. Does this issue have to do with the way JOML multiplies matrices? I have noticed that JOML treats matrices differently than glsl, but I could be wrong. \$\endgroup\$ – naKK May 6 '17 at 21:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.