|
![](/i/fill.gif) |
Vahur Krouverk wrote:
> Remco Poelstra wrote:
> > Because I'm writing a program that does some matrix calculations and
> > outputs to povray.
> > Now I was wondering how the matrices on
> > http://enphilistor.users4.50megs.com/matrix.htm
> > are constructed. I redesigned them by hand, and came out by the same
> > matrices, except that I use the second method to multiply. ie, the
> > vector as a column, not a row.
> >
> If 3x3 matrix (i.e. without transformations) is used then matrix is
> same, regardless of multiplying vector row with matrix (i.e. vectors are
> seen as rows) or matrix with vector column (vectors are seen as
> columns). Difference comes, when You use 4x4 matrix, then matrix is
> different (translation is either in last row or column).
Actually, they don't. If v = <a,b,c> and M is a 3x3 matrix, multiplying the
row vector on the left gives you a different answer than multiplying the
column vector on the right.
v = <a,b,c>
M = d e f
g h i
j k l
vM = <ad+bg+dj, ae+bh+ak, af+bi+cl>
Mv = <ad+be+cf, ag+bh+ci, aj+bk+bl>
If you switch the order of the vector and the matrix, you have to transpose
the matrix
--
Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritone com
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/
"He who hebetates is last."
Post a reply to this message
|
![](/i/fill.gif) |