[Bf-committers] Scale from Matrix
Ramon Carlos Ruiz
ramoncarlosruiz at gmail.com
Sat May 6 23:19:30 CEST 2006
Hi, this is very simple. For Sx first normailze
mat,mat,mat and create n,n,n, that
contain the rotation only. now pick the bigger number of the first row . .
lets said mat, then divide that element with n and that's Sx or
On 5/6/06, Chris Want <cwant at ualberta.ca> wrote:
> Hrmm, this is quite wrong, please disregard
> (serves me right to do math on a Friday night).
> Chris Want wrote:
> > Hi Campbell,
> > My linear algebra is a bit shaky, but I think it goes something
> > like this:
> > Suppose you have mat (the one you are feeding to Mat4ToSize),
> > and the positive output from Mat4ToSize, sx, sy, sz.
> > The real SizeX, SizeY and SizeZ should be eigenvalues of mat.
> > The eigenvectors should be the columns of mat (so first column of
> > mat cooresponds to eigenvalue SizeX, etc). Call these column vectors
> > v1, v2, v3.
> > So, what I believe you should do is test that mat*v1 == sx*v1
> > (both sides are column vectors, left side is matrix multiplication,
> > right side is scalar multiplication).
> > If this is true (within some error tolerance), then sx is indeed
> > the correct eigenvalue, so you can set SizeX = sx,
> > else SizeX = -sx (might be prudent to test that mat*v1 == -sx*v1).
> > Similarly, test mat*v2 = sy*v2 and mat*v3 = sz*v3.
> > Anyways, I hope my recollection isn't too hazy, and that the description
> > isn't too incoherent.
> > Regards,
> > Chris
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at projects.blender.org
> > http://projects.blender.org/mailman/listinfo/bf-committers
> Bf-committers mailing list
> Bf-committers at projects.blender.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Bf-committers