[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15050] trunk/blender/source/blender: Transform Orientations

Martin Poirier theeth at yahoo.com
Fri May 30 10:08:48 CEST 2008


Hi Diego,

Sorry for the trouble, I really should have split that in two.

The part you need is this one:

transform_orientations.c
---

>     if(G.obedit)
>     {
> +        float imat[3][3], mat[3][3];
> +
> +        /* we need the transpose of the inverse for a normal... */
> +        Mat3CpyMat4(imat, ob->obmat);
> +
> +        Mat3Inv(mat, imat);
> +        Mat3Transp(mat);
> +
>         ob= G.obedit;
>
>         if(G.obedit->type==OB_MESH)
> @@ -639,12 +702,48 @@
>             }
>
>         }
> -
> -        Mat4Mul3Vecfl(G.obedit->obmat, plane);
> -        Mat4Mul3Vecfl(G.obedit->obmat, normal);
> +
> +        /* Vectors from edges don't need the special transpose inverse multiplication */
> +        if (result == ORIENTATION_EDGE)
> +        {
> +            Mat4Mul3Vecfl(ob->obmat, normal);
> +            Mat4Mul3Vecfl(ob->obmat, plane);
> +        }
> +        else
> +        {
> +            Mat3MulVecfl(mat, normal);
> +            Mat3MulVecfl(mat, plane);
> +        }


Martin


      


More information about the Bf-committers mailing list