POV-Ray : Newsgroups : povray.general : Matrices Server Time
11 Aug 2024 13:21:58 EDT (-0400)
  Matrices (Message 1 to 10 of 21)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Larry Fontaine
Subject: Matrices
Date: 3 Sep 1999 19:29:13
Message: <37D05831.F6D392CE@isd.net>
Just for anybody who maybe isn't familiar with this feature...
You can use matrices in POV, and they're very useful because you can
shear (only way to do so), and you can multiply them so you only have
one transform statement in your object.
Most of you probably knew that.

Format is:
   matrix <Ax,Ay,Az,Bx,By,Bz,Cx,Cy,Cz,Dx,Dy,Dz>
Matrix transformations in POV:
 translation:
   [  1    0    0  ]
   [  0    1    0  ]
   [  0    0    1  ]
   [  X    Y    Z  ]
 scale:
   [  X    0    0  ]
   [  0    Y    0  ]
   [  0    0    Z  ]
   [  0    0    0  ]
 rotation-x:
   [  1    0    0  ]
   [  0   cos  sin ]
   [  0  -sin  cos ]
   [  0    0    0  ]
 rotation-y:
   [ cos   0  -sin ]
   [  0    1    0  ]
   [ sin   0   cos ]
   [  0    0    0  ]
 rotation-z:
   [ cos  sin   0  ]
   [-sin  cos   0  ]
   [  0    0    1  ]
   [  0    0    0  ]
 shear x and y for z:
   [  1    0    0  ]
   [  0    1    0  ]
   [  X    Y    0  ]
   [  0    0    0  ]
 shear x and z for y:
   [  1    0    0  ]
   [  X    1    Z  ]
   [  0    0    1  ]
   [  0    0    0  ]
 shear y and z for x:
   [  1    Y    Z  ]
   [  0    1    0  ]
   [  0    0    1  ]
   [  0    0    0  ]

Then you can multiply matrices in the order you want the tranforms to be
done and have only one transformation statement for your object.

But Mr.POV, I can't multiply 4x3 matrices together!!!

All matrices are internally converted from
  [ A B C ]
  [ D E F ]
  [ G H I ]
  [ J K L ]
to
  [ A B C 0 ]
  [ D E F 0 ]
  [ G H I 0 ]
  [ J K L 1 ]
(those are zeroes, not o's)
If you want to multiply, use the internal form. Just remember when you
type in the code to use the 4x3 matrix, not the 4x4.
I made a TI-86 program to find POV-matrices. Just select the transform
and enter the numbers. Maybe I'll post it.


Post a reply to this message

From: Lance Birch
Subject: Re: Matrices
Date: 3 Sep 1999 19:37:23
Message: <37d05bb3@news.povray.org>
>But Mr.POV, I can't multiply 4x3 matrices together!!!

Some matrices are non-conformable, so you can't multiply a 4x3 matrix by a
4x3 matrice but you can multiply a 4x3 by a 3x4.

For example:

a = [1, 2, 3]
b = [3, 5, 7]

You can multiply a by b because they're non-conformable matrices.
And also matrices are not commutative or associative under multiplication.

Or was that what you meant anyway?

--
Lance.


---
For the latest 3D Studio MAX plug-ins, images and much more, go to:
The Zone - http://come.to/the.zone
For a totally different experience, visit my Chroma Key Website:
Colorblind - http://listen.to/colorblind


Post a reply to this message

From: Lance Birch
Subject: Re: Matrices
Date: 3 Sep 1999 19:47:13
Message: <37d05e01@news.povray.org>
>You can multiply a by b because they're non-conformable matrices.

LOL. *ahem*  CAN'T sorry... hehe

But then again your obviously already know all of what I just babbled
about... *looks at TI-81 matrix program*

--
Lance.


---
For the latest 3D Studio MAX plug-ins, images and much more, go to:
The Zone - http://come.to/the.zone
For a totally different experience, visit my Chroma Key Website:
Colorblind - http://listen.to/colorblind


Post a reply to this message

From: Larry Fontaine
Subject: Re: Matrices
Date: 3 Sep 1999 19:48:25
Message: <37D05CAF.2317EEA8@isd.net>
Well it doesn't really matter because they're supposed to be 4x4 anyway and
those are multiplyable. Yes, I know, non-commutative blah blah blah I learned
that stuff last year. That's fairly obvious, though, because everybody whose
ever made a POV scene knows that rotate-translate is different from
translate-rotate.

Lance Birch wrote:

> >But Mr.POV, I can't multiply 4x3 matrices together!!!
>
> Some matrices are non-conformable, so you can't multiply a 4x3 matrix by a
> 4x3 matrice but you can multiply a 4x3 by a 3x4.
>
> For example:
>
> a = [1, 2, 3]
> b = [3, 5, 7]
>
> You can multiply a by b because they're non-conformable matrices.
> And also matrices are not commutative or associative under multiplication.
>
> Or was that what you meant anyway?
>
> --
> Lance.
>
> ---
> For the latest 3D Studio MAX plug-ins, images and much more, go to:
> The Zone - http://come.to/the.zone
> For a totally different experience, visit my Chroma Key Website:
> Colorblind - http://listen.to/colorblind


Post a reply to this message

From: Lance Birch
Subject: Re: Matrices
Date: 3 Sep 1999 19:53:40
Message: <37d05f84@news.povray.org>
That's true hehe

I've spent the last 6 months doing matrix stuff in Mathematics C.  Gets
fairly boring when you're given a test and you have to work out the
determinant of 2 3x3 matrices and then use them with Cramer's Rule to work
out the solutions to simultaneous equations, all by hand.  Soo sloooooww...

--
Lance.


---
For the latest 3D Studio MAX plug-ins, images and much more, go to:
The Zone - http://come.to/the.zone
For a totally different experience, visit my Chroma Key Website:
Colorblind - http://listen.to/colorblind
Larry Fontaine wrote in message <37D05CAF.2317EEA8@isd.net>...
>Well it doesn't really matter because they're supposed to be 4x4 anyway and
>those are multiplyable. Yes, I know, non-commutative blah blah blah I
learned
>that stuff last year. That's fairly obvious, though, because everybody
whose
>ever made a POV scene knows that rotate-translate is different from
>translate-rotate.
>
>Lance Birch wrote:
>
>> >But Mr.POV, I can't multiply 4x3 matrices together!!!
>>
>> Some matrices are non-conformable, so you can't multiply a 4x3 matrix by
a
>> 4x3 matrice but you can multiply a 4x3 by a 3x4.
>>
>> For example:
>>
>> a = [1, 2, 3]
>> b = [3, 5, 7]
>>
>> You can multiply a by b because they're non-conformable matrices.
>> And also matrices are not commutative or associative under
multiplication.
>>
>> Or was that what you meant anyway?
>>
>> --
>> Lance.
>>
>> ---
>> For the latest 3D Studio MAX plug-ins, images and much more, go to:
>> The Zone - http://come.to/the.zone
>> For a totally different experience, visit my Chroma Key Website:
>> Colorblind - http://listen.to/colorblind
>


Post a reply to this message

From: John VanSickle
Subject: Re: Matrices
Date: 3 Sep 1999 20:28:08
Message: <37D06AE3.651D63A@erols.com>
Larry Fontaine wrote:
> 
> Just for anybody who maybe isn't familiar with this feature...

I have a whole page devoted to this, and it's fairly well-known
'round here.  You can find it at:

  http://users.erols.com/vansickl/matrix.htm

> You can use matrices in POV, and they're very useful because you can
> shear (only way to do so), and you can multiply them so you only have
> one transform statement in your object.
> Most of you probably knew that.

Yup.

> Format is:
>    matrix <Ax,Ay,Az,Bx,By,Bz,Cx,Cy,Cz,Dx,Dy,Dz>
> Matrix transformations in POV:
>  shear x and y for z:
>    [  1    0    0  ]
>    [  0    1    0  ]
>    [  X    Y    0  ]
>    [  0    0    0  ]

The third row should read:

     [  X    Y    1  ]

> I made a TI-86 program to find POV-matrices. Just select the transform
> and enter the numbers. Maybe I'll post it.

Bah.  I do them in my head.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

From: Mike
Subject: Re: Matrices
Date: 3 Sep 1999 21:31:30
Message: <37D07476.3436F2E@aol.com>
> Just for anybody who maybe isn't familiar with this feature...
> You can use matrices in POV, and they're very useful because you can
> shear (only way to do so)

#include "colors.inc"

camera {location <0, 3, -10> look_at 0 angle 60}

light_source {<0, 5, -5> color 2*White}

//sheared box

box {<-1, -1, -1>, <1, 1, 1>
pigment {checker color White, color Black}
finish {ambient .1 phong 1 phong_size 40}

rotate 45*z
scale <2, 1, 1>
rotate -27*z

translate 2*x
}

//non-sheared box

box {<-1, -1, -1>, <1, 1, 1>
pigment {checker color Black, color White}
finish {ambient .1 phong 1 phong_size 40}

translate -2*x
}

plane {y, -1
pigment {color 0.5*White}
finish {reflection .5}
}

/* neener neener neener ;-) */


Post a reply to this message

From: Larry Fontaine
Subject: Re: Matrices
Date: 3 Sep 1999 22:01:24
Message: <37D07BD8.78953817@isd.net>
Mike wrote:

> > Just for anybody who maybe isn't familiar with this feature...
> > You can use matrices in POV, and they're very useful because you can
> > shear (only way to do so)
>
> #include "colors.inc"
>
> camera {location <0, 3, -10> look_at 0 angle 60}
>
> light_source {<0, 5, -5> color 2*White}
>
> //sheared box
>
> box {<-1, -1, -1>, <1, 1, 1>
> pigment {checker color White, color Black}
> finish {ambient .1 phong 1 phong_size 40}
>
> rotate 45*z
> scale <2, 1, 1>
> rotate -27*z
>
> translate 2*x
> }
>
> //non-sheared box
>
> box {<-1, -1, -1>, <1, 1, 1>
> pigment {checker color Black, color White}
> finish {ambient .1 phong 1 phong_size 40}
>
> translate -2*x
> }
>
> plane {y, -1
> pigment {color 0.5*White}
> finish {reflection .5}
> }
>
> /* neener neener neener ;-) */

I stand corrected. But note, you had to use two statements to do it, and
all other matrix transforms listed have their own POV statement.


Post a reply to this message

From: TonyB
Subject: Re: Matrices
Date: 3 Sep 1999 22:26:01
Message: <37D07442.DE361E75@panama.phoenix.net>
<clinton voice>   Hoowhee! I don't know wut you fellers are talkin' about, but
it sure sounds smart! =)  </clinton voice>

--
Anthony L. Bennett
http://welcome.to/TonyB

Non nova, sed nove.


Post a reply to this message

From: Tony Vigil
Subject: Re: Matrices
Date: 4 Sep 1999 03:12:13
Message: <37D0C892.17E75D3C@gte.net>
This is not completely true.  There is another way...  If you rotate your
object, then add it to a CSG, rescale the CSG, then rotate the CSG the
oposite direction of the first rotation the necessary amount - you do get a
sheared object!

Larry Fontaine wrote:

> Just for anybody who maybe isn't familiar with this feature...
> You can use matrices in POV, and they're very useful because you can
> shear (only way to do so)


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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