Changed Volume Routine, before was returning negative values

This commit is contained in:
Paolo Cignoni 2005-11-15 12:09:17 +00:00
parent ce250c83a2
commit f32fb12d03
1 changed files with 6 additions and 3 deletions

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.15 2005/10/03 16:00:08 rita_borgo
Minor changes
Revision 1.14 2005/03/18 16:37:46 fiorin
Minor changes
@ -266,14 +269,14 @@ ScalarType Volume()
B = ( (*fi).P( k ) - (*fi).P(j) ) ^
( (*fi).P((k+1)%3) - (*fi).P(j) ) ;
B.Normalize();
N = T ^ B;
N = T ^ B;
CoordType pj = (*fi).P(j);
CoordType pk = (*fi).P(k);
V += (pj* T )*(pj*N)*(pj*B);
V += (pk*(-T))*(pk*N)*(pk*B);
V += (pk* T )*(pk*N)*(pk*B);
V += (pj*(-T))*(pj*N)*(pj*B);
}
}
return V/6.0;