diff options
author | Marc Sunet <jeannekamikaze@gmail.com> | 2012-08-30 15:58:46 +0200 |
---|---|---|
committer | Marc Sunet <jeannekamikaze@gmail.com> | 2012-08-30 15:58:46 +0200 |
commit | 5963485d334df2e777d562a831105b0dea837095 (patch) | |
tree | c60e1761ee4af10cca4b5c377031d3f38e32e5ed | |
parent | eaeb27fb615dca2f402536e90e635a8b33202004 (diff) |
Fixed normals
-rw-r--r-- | Spear/Assets/Model/OBJ/OBJ_load.c | 4 |
1 files changed, 1 insertions, 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) | |||
19 | } | 19 | } |
20 | 20 | ||
21 | 21 | ||
22 | // Cross product. | ||
23 | // (0,1,0) x (1,0,0) = (0,0,-1). | ||
24 | static void cross (vec3 a, vec3 b, vec3* c) | 22 | static void cross (vec3 a, vec3 b, vec3* c) |
25 | { | 23 | { |
26 | c->x = a.y * b.z - a.z * b.y; | 24 | c->x = a.y * b.z - a.z * b.y; |
@@ -40,7 +38,7 @@ static void vec3_sub (vec3 a, vec3 b, vec3* out) | |||
40 | static void compute_normal (char clockwise, vec3 p1, vec3 p2, vec3 p3, vec3* n) | 38 | static void compute_normal (char clockwise, vec3 p1, vec3 p2, vec3 p3, vec3* n) |
41 | { | 39 | { |
42 | vec3 v1, v2; | 40 | vec3 v1, v2; |
43 | if (clockwise) | 41 | if (!clockwise) |
44 | { | 42 | { |
45 | vec3_sub (p3, p2, &v1); | 43 | vec3_sub (p3, p2, &v1); |
46 | vec3_sub (p1, p2, &v2); | 44 | vec3_sub (p1, p2, &v2); |