This is the original terrain.

This is how the error affects it on the top.

This is a closeup of a section with dirt.

These errors happen namely around the top of the screen but also the sides and the bottom. Also a triangle that is completely in the center can sometimes disappear. Here is the code I use to determine if I should exclude the triangle (in GLSL).

bool inFrustum( vec3 p,vec3 q,vec3 r) { vec4 Pclip = camera * vec4(p, 1.0f); vec4 Qclip = camera * vec4(q, 1.0f); vec4 Rclip = camera * vec4(r, 1.0f); if(((-Pclip.w>Pclip.x&&-Qclip.w>Qclip.x&&-Rclip.w>Rclip.x)|| (Pclip.x>Pclip.w&&Qclip.x>Qclip.w&&Rclip.x>Rclip.w))|| ((-Pclip.w>Pclip.y&&-Qclip.w>Qclip.y&&-Rclip.w>Rclip.y)||(Pclip.y>Pclip.w&&Qclip.y>Qclip.w&&Rclip.y>Rclip.w))|| ((-Pclip.w>Pclip.z&&-Qclip.w>Qclip.z&&-Rclip.w>Rclip.z)||(Pclip.z>Pclip.w&&Qclip.z>Qclip.w&&Rclip.z>Rclip.w))){ return false; } else{ return true; } }

I am completly certain that my view matrix is correct as has been tested before to perfection. However am I mistaken in assuming I can derive the planes with these inequalities as demonstrated by this site?

I would greatly appreciate any help given! Behemyth

This post has been edited by **stayscrisp**: 10 April 2013 - 03:23 AM

Reason for edit:: Use CODE TAGS!