POV-Ray : Newsgroups : povray.advanced-users : Matrix question Server Time
5 May 2024 03:37:48 EDT (-0400)
  Matrix question (Message 11 to 20 of 24)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>
From: Tor Olav Kristensen
Subject: Re: Matrix question
Date: 22 Dec 2000 16:41:15
Message: <3A43C7B4.31BF7900@online.no>
Rune wrote:
> 
> "Francois Labreque" wrote:
> > [A][B] = [C]
> >
> > Premultiply both sides by the inverse of [A]
> 
> You've lost me. Too tricky for me.

Hello Rune

Back in March i made some POV-macros 
that do matrix calculations on 3x3
matrices stored in POV-arrays.

If you have a look at these two posts:

news://news.povray.org/38CCE1C6.4947A712%40hotmail.com
news://news.povray.org/38CEBC39.582A511F%40online.no

(My thread "Different error messages for same POV-file")

then maybe you are able to see how to find 
the inverse of a matrix with POV-script.
(Look at the Minv macro.)

I think that I also have some newer code 
that does the same (and maybe more) if 
you are interested.


Best regards,

Tor Olav
-- 
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Rune
Subject: Re: Matrix question
Date: 22 Dec 2000 17:55:42
Message: <3a43dbee@news.povray.org>
"Josh English" wrote:
> Silly me, I already solved the problem of how to find the inverse
> of a matrix to deal with a collision model for POV-Ray wth the
> help of a friend

Thank you very much!

To be honest I don't understand any of it, but it seems to work very well.

To really understand it I'd have to learn about matrixes all from the
beginning. I haven't learned about it in school, and I've not been able to
find a place on the net that describes it thoroughly enough.

But it works anyway... :)

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated December 17)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Rune
Subject: Re: Matrix question
Date: 22 Dec 2000 17:55:44
Message: <3a43dbf0@news.povray.org>
"Warp" wrote:
>   Just calculate the inverse matrix of A and then multiply A*C
> (matrix multiplication, not item-by-item multiplication) and
> you'll get B.

Thanks for your help.

If I've understood it correctly, to multiply matrixes in POV-Ray I can
simply apply both matrixes to the object (first A, then C), right?

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated December 17)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Rune
Subject: Re: Matrix question
Date: 22 Dec 2000 17:55:45
Message: <3a43dbf1@news.povray.org>
"Francois Labreque" wrote:
> [A][B] = [C]
>
> [B] = [A-1][C]

Thanks for your help.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated December 17)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Chris Huff
Subject: Re: Matrix question
Date: 22 Dec 2000 19:05:40
Message: <chrishuff-C060DC.19065122122000@news.povray.org>
In article <3a43dbf0@news.povray.org>, "Rune" <run### [at] inamecom> 
wrote:

> If I've understood it correctly, to multiply matrixes in POV-Ray I can
> simply apply both matrixes to the object (first A, then C), right?

Depends on what you want to do...matrices are multiplied together to 
concatenate the transforms, but you won't be able to retrieve the 
matrix. And if you really only want to manipulate objects or vectors, 
and don't care about the matrices themselves, MegaPOV allows you to 
transform vectors and use inverse transformations without needing any 
macros.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Rune
Subject: Re: Matrix question
Date: 23 Dec 2000 10:31:12
Message: <3a44c540@news.povray.org>
"Chris Huff" wrote:
> "Rune" wrote:
>
> > If I've understood it correctly, to multiply matrixes in
> > POV-Ray I can simply apply both matrixes to the object
> > (first A, then C), right?
>
> Depends on what you want to do...matrices are multiplied
> together to concatenate the transforms, but you won't be
> able to retrieve the matrix.

I haven't figured it all out yet, but I *think* I won't need the matrix
itself.

> And if you really only want to manipulate objects or
> vectors, and don't care about the matrices themselves,
> MegaPOV allows you to transform vectors and use inverse
> transformations without needing any macros.

Uh, clever!

Erm, hehe, I guess that means I don't need the inverse matrix macro after
all...

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated December 17)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Warp
Subject: Re: Matrix question
Date: 24 Dec 2000 12:17:09
Message: <3a462f94@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
: They're not really.  The fourth column is just a convenient way of specifying
: the translate component.  You could easily take that out, invert, and put 
: it back.

  But aren't the rays also translated with the inverse translation of the
object? Isn't the whole 4x4 matrix inverted?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: Matrix question
Date: 24 Dec 2000 12:56:40
Message: <slrn94ce3t.5q0.ron.parker@fwi.com>
On 24 Dec 2000 12:17:09 -0500, Warp wrote:
>Ron Parker <ron### [at] povrayorg> wrote:
>: They're not really.  The fourth column is just a convenient way of specifying
>: the translate component.  You could easily take that out, invert, and put 
>: it back.
>
>  But aren't the rays also translated with the inverse translation of the
>object? Isn't the whole 4x4 matrix inverted?

Yes, but it's easiest to invert the 3x3 matrix and then tack on the inverse
translation than to try to invert the whole thing.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Warp
Subject: Re: Matrix question
Date: 24 Dec 2000 13:22:46
Message: <3a463ef5@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
: Yes, but it's easiest to invert the 3x3 matrix and then tack on the inverse
: translation than to try to invert the whole thing.

  But would inverting the whole 4x4 matrix work as well?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: Matrix question
Date: 24 Dec 2000 19:38:37
Message: <slrn94d5ks.60e.ron.parker@fwi.com>
On 24 Dec 2000 13:22:46 -0500, Warp wrote:
>Ron Parker <ron### [at] povrayorg> wrote:
>: Yes, but it's easiest to invert the 3x3 matrix and then tack on the inverse
>: translation than to try to invert the whole thing.
>
>  But would inverting the whole 4x4 matrix work as well?

Of course.  

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>

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