POV-Ray : Newsgroups : povray.general : matrix question Server Time
15 Nov 2024 01:16:11 EST (-0500)
  matrix question (Message 1 to 8 of 8)  
From: Rune S  Johansen
Subject: matrix question
Date: 30 Mar 1999 17:41:01
Message: <370152fd.0@news.povray.org>
Normally a matrix can transform
an object so the point x can become
P1, y can become P2, z can become
P3 and the origin becomes P4.
How can I do this thing backwards?
I.e. P1 becomes x, P2 becomes y,
P3 becomes z, and P4 becomes the
origin. The way I tried it I only
got a lot of divide by zero warnings.

Thanks,

Rune S. Johansen
http://hjem.get2net.dk/rsj


Post a reply to this message

From: Nieminen Mika
Subject: Re: matrix question
Date: 31 Mar 1999 02:11:34
Message: <3701caa6.0@news.povray.org>
Rune S. Johansen <run### [at] get2netdk> wrote:
: Normally a matrix can transform
: an object so the point x can become
: P1, y can become P2, z can become
: P3 and the origin becomes P4.
: How can I do this thing backwards?

  I think that in this case you have to transform them with the inverse of
the matrix.
  Somebody can tell you how the inverse of a matrix is calculated.

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


Post a reply to this message

From: Thomas Willhalm
Subject: Re: matrix question
Date: 31 Mar 1999 08:53:19
Message: <qqmbth93gvk.fsf@goldach.fmi.uni-konstanz.de>
"Rune S. Johansen" <run### [at] get2netdk> writes:

> Normally a matrix can transform
> an object so the point x can become
> P1, y can become P2, z can become
> P3 and the origin becomes P4.
> How can I do this thing backwards?
> I.e. P1 becomes x, P2 becomes y,
> P3 becomes z, and P4 becomes the
> origin. The way I tried it I only
> got a lot of divide by zero warnings.

In practice, the matrix keyword in povray divides into a
- a linear function given by the matrix entries Val00 to Val22
- a transformation given by Val30 to Val32

If you want to calculate the inverse function, you have to
- invert the 3x3 matrix Val00 to Val22
- take the negative of the vector Val30 to Val32
How to calculate a inverse matrix should be described in every
linear algebra book. Keep in mind, that not every matrix is
invertible.

I hope this helps

Thomas

-- 
http://www.fmi.uni-konstanz.de/~willhalm


Post a reply to this message

From: Lance Birch
Subject: Re: matrix question
Date: 1 Apr 1999 02:16:02
Message: <37031d32.0@news.povray.org>
Hmm, wait a second, you can't "invert" a matrix can you?  You need an
operation to do that... (e.g. a*aT). I'm studying Set and Group Theory and
Logic at the moment and as far as I can see, I think you are either talking
about the transpose of the matrix or matrix multiplication by the transpose
of the matrix (in which you are correct, you can't *multiply* all matrices
because they need to have order [a,b] [c,a])

Or do you mean scalar multiplication on the matrix with an operator?

--
Lance.


---
For the latest 3D Studio MAX plug-ins, images and much more, go to:
The Zone - http://come.to/the.zone


Post a reply to this message

From: Ron Parker
Subject: Re: matrix question
Date: 1 Apr 1999 08:19:34
Message: <37037266.0@news.povray.org>
On Thu, 1 Apr 1999 17:10:25 +1000, Lance Birch <lan### [at] usanet> wrote:
>Hmm, wait a second, you can't "invert" a matrix can you?  

The inverse of a (square) matrix A is the matrix A' that satisfies
the property A x A' = I, where I is the identity matrix and x stands
for the matrix multiplication operator[1].  A' may or may not exist for 
a given matrix A, but if it does it is unique.

[1] I wish more people understood \TeX notation...  $A\times A^{-1}=I$.


Post a reply to this message

From: Lance Birch
Subject: Re: matrix question
Date: 1 Apr 1999 22:03:44
Message: <37043390.0@news.povray.org>
Ah, OK, now I see what you mean!  Of course, I should have thought of that,
it's the same in Set Theory...  [Lance needs more caffeine...and more
sleep...]

--
Lance.


---
For the latest 3D Studio MAX plug-ins, images and much more, go to:
The Zone - http://come.to/the.zone


Post a reply to this message

From: John VanSickle
Subject: Re: matrix question
Date: 2 Apr 1999 21:49:28
Message: <37058337.E3616EBD@erols.com>
Thomas Willhalm wrote:
> 
> "Rune S. Johansen" <run### [at] get2netdk> writes:
> 
> > Normally a matrix can transform
> > an object so the point x can become
> > P1, y can become P2, z can become
> > P3 and the origin becomes P4.
> > How can I do this thing backwards?
> > I.e. P1 becomes x, P2 becomes y,
> > P3 becomes z, and P4 becomes the
> > origin. The way I tried it I only
> > got a lot of divide by zero warnings.
> 
> In practice, the matrix keyword in povray divides into a
> - a linear function given by the matrix entries Val00 to Val22
> - a transformation given by Val30 to Val32
      ^^^^^^^^^^^^^^

This should be "translation."

> If you want to calculate the inverse function, you have to
> - invert the 3x3 matrix Val00 to Val22
> - take the negative of the vector Val30 to Val32

Pretty much; IIRC, the inverted 3x3 has to be applied to the
negated vector to yield the final result.  I've been scribbling
notes for a suite of macros to fiddle with matrices, mainly
because (a) there is no one-stop-shop for inverting a general
matrix in POV-Ray (without doing the math oneself), (b)
POV-Ray does not provide access to the elements within a
transform, and (c) I wanted to provide a macro with the package
to explicitly perform shears.

> How to calculate a inverse matrix should be described in every
> linear algebra book. Keep in mind, that not every matrix is
> invertible.

Yes, but the matrices that are not invertible are not valid for
use in transformations.  They're easy to spot:  The first nine
elements, when taken as a 3x3 matrix, yields a determinant = 0.

If you give one of these to POV-Ray, you'll get a fatal error.

Regards,
John


Post a reply to this message

From: Rune S  Johansen
Subject: Re: matrix question
Date: 4 Apr 1999 17:15:06
Message: <3707c84a.0@news.povray.org>
John VanSickle wrote:
>Thomas Willhalm wrote:
>>
>> "Rune S. Johansen" <run### [at] get2netdk> writes:
>>
>> > Normally a matrix can transform
>> > an object so the point x can become
>> > P1, y can become P2, z can become
>> > P3 and the origin becomes P4.
>> > How can I do this thing backwards?
>> > I.e. P1 becomes x, P2 becomes y,
>> > P3 becomes z, and P4 becomes the
>> > origin. The way I tried it I only
>> > got a lot of divide by zero warnings.
>>
>> In practice, the matrix keyword in povray divides into a
>> - a linear function given by the matrix entries Val00 to Val22
>> - a transformation given by Val30 to Val32
>      ^^^^^^^^^^^^^^
>
>This should be "translation."
>
>> If you want to calculate the inverse function, you have to
>> - invert the 3x3 matrix Val00 to Val22
>> - take the negative of the vector Val30 to Val32
>
>Pretty much; IIRC, the inverted 3x3 has to be applied to the
>negated vector to yield the final result.  I've been scribbling
>notes for a suite of macros to fiddle with matrices, mainly
>because (a) there is no one-stop-shop for inverting a general
>matrix in POV-Ray (without doing the math oneself), (b)
>POV-Ray does not provide access to the elements within a
>transform, and (c) I wanted to provide a macro with the package
>to explicitly perform shears.
>
>> How to calculate a inverse matrix should be described in every
>> linear algebra book. Keep in mind, that not every matrix is
>> invertible.
>
>Yes, but the matrices that are not invertible are not valid for
>use in transformations.  They're easy to spot:  The first nine
>elements, when taken as a 3x3 matrix, yields a determinant = 0.
>
>If you give one of these to POV-Ray, you'll get a fatal error.
>
>Regards,
>John

So, I should be able to get the inverse function in ANY case.
I'd just appreciate an example or two so I will be able to
understand how.

Thanks,

Rune S. Johansen
http://hjem.get2net.dk/rsj


Post a reply to this message

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