terrain working - no culling
[demo] / src / meshgen.cc
index c6a4f48..ddcd571 100644 (file)
@@ -179,7 +179,7 @@ void gen_heightfield(Mesh *mesh, float xsz, float ysz, float height, int usub,
                        Vec3 bitangent = hfield_vertex(u, v + dv, calc_height(u, v + dv, ptr),
                                        xsz, ysz, height) - vtx;
 
-                       Vec3 normal = normalize(cross(tangent, bitangent));
+                       Vec3 normal = normalize(cross(bitangent, tangent));
 
                        mesh->vertices[vidx] = vtx;
                        mesh->normals[vidx] = normal;