Hi there. I’m trying to make a flat shaded heightmap rendering engine, but I can’t seem to get it looking the way it should. I’ve asked around and rechecked but it just refuses to work.
I’ve posted the code I use to calculate my normals and then render the triangles. Maybe someone with an eye for OpenGL rendering can see what’s going on here.
------- Source code ---------
http://utilitybase.com/paste/26026 <-- Vector and cross product classes and functions
http://ec.codepad.org/NsxUim61 <-- Code to calculate normals
http://ec.codepad.org/l3rUCvUR <-- Rendering code(no VBO)