From 79fc9ce029be3e91d3249a654f84c7a1ce1ff9ee Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Thu, 07 Jun 2012 19:46:44 +0000
Subject: [PATCH] spherical harmonics coefficients co fixed and working. Zero based indexing was solved in such a manner, that we allocated more memory that is required by coefficients.

---
 src/triangle.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/triangle.c b/src/triangle.c
index f842130..bcd074b 100644
--- a/src/triangle.c
+++ b/src/triangle.c
@@ -194,12 +194,12 @@
   */
 ts_bool triangle_normal_vector(ts_triangle *tria){
 	ts_double x21,x31,y21,y31,z21,z31,xden;
-	x21=tria->vertex[1]->data->x - tria->vertex[0]->data->x;
-	x31=tria->vertex[2]->data->x - tria->vertex[0]->data->x;
-	y21=tria->vertex[1]->data->y - tria->vertex[0]->data->y;
-	y31=tria->vertex[2]->data->y - tria->vertex[0]->data->y;
-	z21=tria->vertex[1]->data->z - tria->vertex[0]->data->z;
-	z31=tria->vertex[2]->data->z - tria->vertex[0]->data->z;
+	x21=tria->vertex[1]->x - tria->vertex[0]->x;
+	x31=tria->vertex[2]->x - tria->vertex[0]->x;
+	y21=tria->vertex[1]->y - tria->vertex[0]->y;
+	y31=tria->vertex[2]->y - tria->vertex[0]->y;
+	z21=tria->vertex[1]->z - tria->vertex[0]->z;
+	z31=tria->vertex[2]->z - tria->vertex[0]->z;
 
 	tria->xnorm=y21*z31 - z21*y31;
 	tria->ynorm=z21*x31 - x21*z31;

--
Gitblit v1.9.3