Original Post
As far as I can tell, this code should work. Obviously its not though, so I need some help. I can't seem to properly find the height at any given point on my heightmap made of triangle strips. I'm trying to use the equation of the plane that the triangle is in to find the height, but I'm getting some strange results. It works perfectly when above certain triangles, but is WAY off on others, and I can't seem to find any reason as to when it will or will not work. Here's my code: float Terrain::getHeightAtPoint(float x, float z) { float normal[3]; // set 'normal' to the normal of the triangle (x, z) falls within getNormalAtPoint(x, z, normal); // find the points of the triangle (x,z) falls within point p1, p2, p3; findSurroundingPoints(x, z, p1, p2, p3); // find d float d = -normal[0]*p1.x + -normal[1]*p1.y + -normal[2]*p1.z; float height = (-d - (normal[0]*x) - (normal[2]*z)) / normal[1]; return height; }