LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: nickbrickmaster on January 20, 2014, 17:19:14

Title: Frustum culling difficulties
Post by: nickbrickmaster on January 20, 2014, 17:19:14
I'm trying to implement frustum culling, following Lighthouse3D's geometric approach. http://www.lighthouse3d.com/tutorials/view-frustum-culling/ (http://www.lighthouse3d.com/tutorials/view-frustum-culling/)
My problem is that some objects disappear if looked at from the wrong angle, e.g. my rotating Suzanne disappears if the right ear is facing +Z, and you can't get too close to the level or look at it from the top.

https://github.com/epicfacecreeper/Demigod/blob/master/src/main/java/net/cyberninjapiggy/demigod/graphics/FlyingCamera.java#L126 (https://github.com/epicfacecreeper/Demigod/blob/master/src/main/java/net/cyberninjapiggy/demigod/graphics/FlyingCamera.java#L126) is where I calculate the frustum planes (calcPlane and the box check are farther down), https://github.com/epicfacecreeper/Demigod/blob/master/src/main/java/net/cyberninjapiggy/demigod/graphics/render/Render.java#L424 (https://github.com/epicfacecreeper/Demigod/blob/master/src/main/java/net/cyberninjapiggy/demigod/graphics/render/Render.java#L424) is where the bounding box is generated.

Thanks for any help you can give.