[info-performer] matrix puzzle

New Message Reply Date view Thread view Subject view Author view

From: Florian Berger (florian.berger++at++aec.at)
Date: 10/02/2002 03:11:59


hi there

i have a problem, well actually i have solved it, but...
i want to do the following:

translate a model to the origin,
rescale it by some factor,
translate it somewhere else.

to me this would have to be done that way:

mat.preTrans( -orig[0],-orig[1],-orig[2], mat );
mat.preScale( scale,scale,scale, mat );
mat.preTrans( somewhere[0], somewhere[1], somewhere[2], mat );

but to my surprise, by trying around a bit i figured out that this gives the
desired results:

mat.preTrans( -orig[0]*scale,-orig[1]*scale,-orig[2]*scale, mat );
mat.preScale( scale,scale,scale, mat );
mat.preTrans( somewhere[0]/scale, somewhere[1]/scale, somewhere[2]/scale,
mat );

i know one has to take care of translations combined with scales and such,
and i really thought about it carefully, but the above thing really puzzles
me.
multiplying a translation matrix from the left side should simply add the
translation vector values to the last column, shouldnt it?

thanks in advance, and
never hesitate to argue with success :),
  floh

------------------------------------------------------------
Dipl.-Ing. Florian Berger
Email: florian.berger++at++aec.at
Homepage: http://www.geocities.com/harpin_floh


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Oct 02 2002 - 03:10:21 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.