Images attached below.
The right and top bounds of the frustum seem to be working correctly, however the further left/up I look, the more the cubes that are supposed to be visible are clipped.
The first image isn’t clipping any visible cubes just as expected.
Right now Im using a Frustum class(slightly modified) I found online as well as a Camera class I found online.
Frustum original:
http://www.java-gaming.org/index.php?action=pastebin&hex=83b53604950
Frustum Modified code
http://pastebin.java-gaming.org/3e9ac0d9d86
Camera relevant code
http://pastebin.java-gaming.org/e9acd1d968b
World Rendering(camera.apply(); is being called before this as well as setting the shader)
public void draw() {
for (int x = 0; x < width(); x++)
{
for (int y = 0; y < height(); y++)
{
for (int z = 0; z < depth(); z++)
{
if (blocks[x][y][z] != null)
{
if (Window.frustum.cubeInFrustum(x * 8, y * 8, z * 8, 8))
{
Renderer3D.drawCube(x * 16, y * 16, z * 16, 16, 16, 16, BlockRegistry.getBlock(blocks[x][y][z]).texture);
}
}
}
}
}
}
Looks like it depends on the angle im looking at it. If I look at one side, everything looks completely fine. Now Im thinking it’s the projection matrix that’s messed up somehow.
http://postimg.org/image/5ee89b2pn/
http://postimg.org/image/poswybwkf/