[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32369] trunk/blender/source/blender/ blenlib/intern/math_rotation.c: fix for error in track rotation, found while looking into adding an up axis to this function.

Campbell Barton ideasman42 at gmail.com
Fri Oct 8 05:50:03 CEST 2010


Revision: 32369
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32369
Author:   campbellbarton
Date:     2010-10-08 05:50:01 +0200 (Fri, 08 Oct 2010)

Log Message:
-----------
fix for error in track rotation, found while looking into adding an up axis to this function.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/math_rotation.c

Modified: trunk/blender/source/blender/blenlib/intern/math_rotation.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_rotation.c	2010-10-08 02:48:24 UTC (rev 32368)
+++ trunk/blender/source/blender/blenlib/intern/math_rotation.c	2010-10-08 03:50:01 UTC (rev 32369)
@@ -1542,10 +1542,10 @@
 	   float axis[3]= {0,0,2}; axis_angle_to_quat(q, axis, -90 * (M_PI / 180)); */
 
 	/* notice x/y flipped intentionally */
-	const float quat_track[][4]= {{0.70710676908493, 0.0, 0.70710676908493, 0.0},  /* pos-y */ 
+	const float quat_track[][4]= {{0.70710676908493, 0.0, -0.70710676908493, 0.0},  /* pos-y */ 
 	                              {0.70710676908493, 0.70710676908493, 0.0, 0.0},  /* pos-x */ 
 	                              {0.70710676908493, 0.0, 0.0, 0.70710676908493},  /* pos-z */ 
-	                              {0.70710676908493, 0.0, -0.70710676908493, 0.0}, /* neg-y */ 
+	                              {0.70710676908493, 0.0, 0.70710676908493, 0.0}, /* neg-y */ 
 	                              {0.70710676908493, -0.70710676908493, 0.0, 0.0}, /* neg-x */ 
 	                              {0.70710676908493, 0.0, 0.0, -0.70710676908493}};/* neg-z */ 
 	
@@ -1562,7 +1562,7 @@
 	case 0: /* pos-x */
 		/* vec[0]=  0.0; */
 		vec[1]=  tvec[2];
-		vec[2]=  tvec[1];
+		vec[2]=  -tvec[1];
 		break;
 	case 1: /* pos-y */
 		vec[0]=  tvec[2];
@@ -1577,7 +1577,7 @@
 	case 3: /* neg-x */
 		/* vec[0]=  0.0; */
 		vec[1]= -tvec[1];
-		vec[2]=  tvec[2];
+		vec[2]= -tvec[2];
 		break;
 	case 4: /* neg-y */
 		vec[0]= -tvec[0];





More information about the Bf-blender-cvs mailing list