[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11894] branches/soc-2007-maike/release/ glsl/node_vectmath_cross.gsl: Cross product vector math node glsl generic function bugfix
Miguel Torres Lima
torreslima at gmail.com
Thu Aug 30 19:26:26 CEST 2007
Revision: 11894
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11894
Author: maike
Date: 2007-08-30 19:26:26 +0200 (Thu, 30 Aug 2007)
Log Message:
-----------
Cross product vector math node glsl generic function bugfix
All the vector math node functions work right now
Modified Paths:
--------------
branches/soc-2007-maike/release/glsl/node_vectmath_cross.gsl
Modified: branches/soc-2007-maike/release/glsl/node_vectmath_cross.gsl
===================================================================
--- branches/soc-2007-maike/release/glsl/node_vectmath_cross.gsl 2007-08-30 17:23:22 UTC (rev 11893)
+++ branches/soc-2007-maike/release/glsl/node_vectmath_cross.gsl 2007-08-30 17:26:26 UTC (rev 11894)
@@ -1,11 +1,9 @@
void node_vectmath_cross(vec3 vect1, vec3 vect2, inout vec3 vect, inout float val)
{
- vec3 nlz;
-
vect[0] = (vect1[1] * vect2[2]) - (vect1[2] * vect2[1]);
vect[1] = (vect1[2] * vect2[0]) - (vect1[0] * vect2[2]);
vect[2] = (vect1[0] * vect2[1]) - (vect1[1] * vect2[0]);
- nlz = normalize(vect);
- val = nlz.x;
+ val = max(sqrt(vect.x * vect.x + vect.y * vect.y + vect.z * vect.z), 0.0);
+ vect = normalize(vect);
}
More information about the Bf-blender-cvs
mailing list