[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19591] trunk/blender/source/blender/src: etch-a-ton

Martin Poirier theeth at yahoo.com
Tue Apr 7 22:05:33 CEST 2009


Revision: 19591
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19591
Author:   theeth
Date:     2009-04-07 22:05:32 +0200 (Tue, 07 Apr 2009)

Log Message:
-----------
etch-a-ton

Use head not tail normal for bone orientation.
Simplify roll to normal a bit.

Modified Paths:
--------------
    trunk/blender/source/blender/src/editarmature_generate.c
    trunk/blender/source/blender/src/editarmature_sketch.c

Modified: trunk/blender/source/blender/src/editarmature_generate.c
===================================================================
--- trunk/blender/source/blender/src/editarmature_generate.c	2009-04-07 19:57:30 UTC (rev 19590)
+++ trunk/blender/source/blender/src/editarmature_generate.c	2009-04-07 20:05:32 UTC (rev 19591)
@@ -51,14 +51,14 @@
 {
 	if (no != NULL && !VecIsNull(no))
 	{
-		float tangent[3], cotangent[3], normal[3];
+		float tangent[3], vec[3], normal[3];
 
 		VECCOPY(normal, no);	
 		Mat3MulVecfl(tmat, normal);
 
 		VecSubf(tangent, bone->tail, bone->head);
-		Crossf(cotangent, tangent, normal);
-		Crossf(normal, cotangent, tangent);
+		Projf(vec, tangent, normal);
+		VecSubf(normal, normal, vec);
 		
 		Normalize(normal);
 		

Modified: trunk/blender/source/blender/src/editarmature_sketch.c
===================================================================
--- trunk/blender/source/blender/src/editarmature_sketch.c	2009-04-07 19:57:30 UTC (rev 19590)
+++ trunk/blender/source/blender/src/editarmature_sketch.c	2009-04-07 20:05:32 UTC (rev 19591)
@@ -1011,7 +1011,22 @@
 		}
 		
 		glEnd();
-	
+
+#if 0	
+		glColor3f(0, 0, 1);
+		glBegin(GL_LINES);
+
+		for (i = 0; i < stk->nb_points; i++)
+		{
+			float *p = stk->points[i].p;
+			float *no = stk->points[i].no;
+			glVertex3fv(p);
+			glVertex3f(p[0] + no[0], p[1] + no[1], p[2] + no[2]);
+		}
+		
+		glEnd();
+#endif
+
 		glColor3f(0, 0, 0);
 		glBegin(GL_POINTS);
 	
@@ -1961,7 +1976,7 @@
 
 					Mat4MulVecfl(invmat, bone->head);
 					Mat4MulVecfl(invmat, bone->tail);
-					setBoneRollFromNormal(bone, pt->no, invmat, tmat);
+					setBoneRollFromNormal(bone, head->no, invmat, tmat);
 				}
 				
 				new_parent = bone;





More information about the Bf-blender-cvs mailing list