From 5963485d334df2e777d562a831105b0dea837095 Mon Sep 17 00:00:00 2001 From: Marc Sunet Date: Thu, 30 Aug 2012 15:58:46 +0200 Subject: Fixed normals --- Spear/Assets/Model/OBJ/OBJ_load.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Spear/Assets/Model/OBJ/OBJ_load.c b/Spear/Assets/Model/OBJ/OBJ_load.c index 2474091..594ea0f 100644 --- a/Spear/Assets/Model/OBJ/OBJ_load.c +++ b/Spear/Assets/Model/OBJ/OBJ_load.c @@ -19,8 +19,6 @@ static void safe_free (void* ptr) } -// Cross product. -// (0,1,0) x (1,0,0) = (0,0,-1). static void cross (vec3 a, vec3 b, vec3* c) { c->x = a.y * b.z - a.z * b.y; @@ -40,7 +38,7 @@ static void vec3_sub (vec3 a, vec3 b, vec3* out) static void compute_normal (char clockwise, vec3 p1, vec3 p2, vec3 p3, vec3* n) { vec3 v1, v2; - if (clockwise) + if (!clockwise) { vec3_sub (p3, p2, &v1); vec3_sub (p1, p2, &v2); -- cgit v1.2.3