[Bf-committers] Changes to Mat3ToSize...

Martin Poirier theeth at yahoo.com
Sun Mar 27 21:40:25 CEST 2005


--- Ton Roosendaal <ton at blender.org> wrote:
> ton (Ton Roosendaal) 2005/03/27 20:17:48 CEST
> 
>   Last one i need Martin P for! Note that I had to
> change Mat3ToSize....
>   
>   Revision  Changes    Path
>   1.23      +4 -2     
> blender/source/blender/blenlib/intern/arithb.c
>
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/blenlib/intern/arithb.c.diff?r1=1.22&r2=1.23&cvsroot=bf-blender>

The flipping part ("if(vec[0]<0.0) size[0]=
-size[0];") assumes the matrix is aligned with global
space while the rest clearly doesn't. Simply put, it
won't work correctly for rotated size matrix.

To solve this, you'd need to renormalise the matrix
(to get just the rot matrix), invert it and multiply
the original size matrix with it. This would give a
matrix with mat[0][0] == size[0], mat[1][1] == size[1]
and mat[2][2] == size[2].

This isn't too fast though.

Hopefully someone better in math (zr perhaps) has a
better solution.

Martin


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail


More information about the Bf-committers mailing list