POV-Ray : Newsgroups : povray.general : Matrix commands Server Time
12 Aug 2024 09:23:42 EDT (-0400)
  Matrix commands (Message 1 to 5 of 5)  
From: Josh English
Subject: Matrix commands
Date: 9 Mar 1999 20:23:02
Message: <36E5C8D2.9C179299@spiritone.com>
I was reading a web site that explained the way the Matrix command
works, but it intentionally disregarded the math behind it. I was
wondering if POV-Ray used normal matrix mulitplication or if it used
another algorithm for translating things. If I were to pick up my old
high school textbooks and brushed up on matrixes there, would I get the
same results as POV-Ray?

Thanks,

Josh


Post a reply to this message

From: Gordon
Subject: Re: Matrix commands
Date: 10 Mar 1999 06:46:14
Message: <36e65b86.0@news.povray.org>
As far as I can figure, it does. Have a look at the scene language help
under Matrix. It explains exactly what the maths is. You should look up
homogeneous coordinates in your texts.

Good Luck
Gordon
<gbe### [at] birdcameroncomau>

Josh English wrote in message <36E5C8D2.9C179299@spiritone.com>...
>I was reading a web site that explained the way the Matrix command
>works, but it intentionally disregarded the math behind it. I was
>wondering if POV-Ray used normal matrix mulitplication or if it used
>another algorithm for translating things. If I were to pick up my old
>high school textbooks and brushed up on matrixes there, would I get the
>same results as POV-Ray?
>
>Thanks,
>
>Josh
>


Post a reply to this message

From: Josh English
Subject: Re: Matrix commands
Date: 10 Mar 1999 11:16:38
Message: <36E69B4A.8CDEE8CB@spiritone.com>
Yeah, that helps, but the webiste I was looking at (and didn't have the URL
fer earlier) is at www.erols.com/vansickl/ and it mentions that matrices are
multiplied together during parsing so multiple transformations are handled
at roughly the same speed. It is mostly academic at this point, but I would
like to see how they are combined... I suppose I could do a lot of
experimentation. Thanks,

Josh

Gordon wrote:

> As far as I can figure, it does. Have a look at the scene language help
> under Matrix. It explains exactly what the maths is. You should look up
> homogeneous coordinates in your texts.
>
> Good Luck
> Gordon
> <gbe### [at] birdcameroncomau>
>
> Josh English wrote in message <36E5C8D2.9C179299@spiritone.com>...
> >I was reading a web site that explained the way the Matrix command
> >works, but it intentionally disregarded the math behind it. I was
> >wondering if POV-Ray used normal matrix mulitplication or if it used
> >another algorithm for translating things. If I were to pick up my old
> >high school textbooks and brushed up on matrixes there, would I get the
> >same results as POV-Ray?
> >
> >Thanks,
> >
> >Josh
> >

--
Josh English
eng### [at] spiritonecom
www.spiritone.com/~english


Post a reply to this message

From: Gordon
Subject: Re: Matrix commands
Date: 10 Mar 1999 20:32:22
Message: <36e71d26.0@news.povray.org>
I think you'll find that they do work that way, but ultimately you should do
a few experiments to be sure. One thing to keep in mind is that the order of
multiplication IS important, but the web site and your texts probably
mentions this.

Gordon

Josh English wrote in message <36E69B4A.8CDEE8CB@spiritone.com>...
>Yeah, that helps, but the webiste I was looking at (and didn't have the URL
>fer earlier) is at www.erols.com/vansickl/ and it mentions that matrices
are
>multiplied together during parsing so multiple transformations are handled
>at roughly the same speed. It is mostly academic at this point, but I would
>like to see how they are combined... I suppose I could do a lot of
>experimentation. Thanks,
>
>Josh
>
>Gordon wrote:
>
>> As far as I can figure, it does. Have a look at the scene language help
>> under Matrix. It explains exactly what the maths is. You should look up
>> homogeneous coordinates in your texts.
>>
>> Good Luck
>> Gordon
>> <gbe### [at] birdcameroncomau>
>>
>> Josh English wrote in message <36E5C8D2.9C179299@spiritone.com>...
>> >I was reading a web site that explained the way the Matrix command
>> >works, but it intentionally disregarded the math behind it. I was
>> >wondering if POV-Ray used normal matrix mulitplication or if it used
>> >another algorithm for translating things. If I were to pick up my old
>> >high school textbooks and brushed up on matrixes there, would I get the
>> >same results as POV-Ray?
>> >
>> >Thanks,
>> >
>> >Josh
>> >
>
>--
>Josh English
>eng### [at] spiritonecom
>www.spiritone.com/~english
>
>


Post a reply to this message

From: John VanSickle
Subject: Re: Matrix commands
Date: 10 Mar 1999 22:21:11
Message: <36E737E4.B0515DDB@erols.com>
Gordon wrote:
> 
> Josh English wrote in message <36E69B4A.8CDEE8CB@spiritone.com>...
>
> >Yeah, that helps, but the webiste I was looking at (and didn't have the URL
> >fer earlier) is at www.erols.com/vansickl/ and it mentions that matrices are
> >multiplied together during parsing so multiple transformations are handled
> >at roughly the same speed. It is mostly academic at this point, but I would
> >like to see how they are combined... I suppose I could do a lot of
> >experimentation. Thanks,
>
> I think you'll find that they do work that way, but ultimately you should do
> a few experiments to be sure. One thing to keep in mind is that the order of
> multiplication IS important, but the web site and your texts probably
> mentions this.

Internally, a POV-Ray matrix looks like this:

 A B C 0
 D E F 0
 G H I 0
 J K L 1

the fourth column is zero, zero, zero, one.

If you have another matrix,

 M N P 0
 Q R S 0
 T U V 0
 W X Y 1

then the first is multiplied by the second, they yield

 A*M+B*Q+C*T   A*N+B*R+C*U   A*P+B*S+C*V   0
 D*M+E*Q+F*T   D*N+E*R+F*U   D*P+E*S+F*V   0
 G*M+H*Q+I*T   G*N+H*R+I*U   G*P+H*S+I*V   0
 J*M+K*Q+L*T+W J*N+K*R+L*U+X J*P+K*S+L*V+Y 1

If you reverse the order of multiplication, the results will be different
except in a few special cases.  Verification of this is left as an
exercise for the interested student with nothing better to do.

Regards,
John


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.