POV-Ray : Newsgroups : povray.general : Transforming matrix question Server Time
1 Nov 2024 03:16:42 EDT (-0400)
  Transforming matrix question (Message 1 to 6 of 6)  
From: Louis
Subject: Transforming matrix question
Date: 23 Dec 2013 19:50:00
Message: <web.52b8d924de711b8ccbe7ea7c0@news.povray.org>
I have read the documentation and the excellent tutorial on
http://evilsnack.byethost22.com/matrix.htm but I must admit that I cannot fully
grasp the concept and have great difficulty visualizing or predicting the
effect.

The last mathemagical example in the tutorial (the saddle) showed off a nice
curved shape, and lead me to think that the matrix transform can do some
spline-like transforms, like pinch, barrel and maybe even extruding an object
into a helix-formed shape, but when experimenting I'm getting confusing results.

Could someone provide an example of a cube with the top rotated 90 degrees while
the base stays in it's place? And would it be possible to have the edges have an
S form instead of a straight line using a matrix transform?

I tried using formulas inside the matrix, for example:

matrix <  1,  0.5*(sin(z.z*2*pi)),  0,
            0,  1,  0,
            0,  0,  1,
            0,  0,  0 >

But I never see any curves, while I was expecting to see some wobble in at least
one of the edges. Probably I'm misunderstanding the whole concept?


Post a reply to this message

From: Warp
Subject: Re: Transforming matrix question
Date: 24 Dec 2013 03:58:53
Message: <52b94ccd@news.povray.org>
Louis <nomail@nomail> wrote:
> The last mathemagical example in the tutorial (the saddle) showed off a nice
> curved shape, and lead me to think that the matrix transform can do some
> spline-like transforms, like pinch, barrel and maybe even extruding an object
> into a helix-formed shape, but when experimenting I'm getting confusing results.

Transformation matrices only allow for affine transformations. That's
transformations where every straight line in the original object
remains straight after the transformation. (In practice this means
translations, rotations, scalings, and any combination of those.)
Thus no twists are possible.

-- 
                                                          - Warp


Post a reply to this message

From: Louis
Subject: Re: Transforming matrix question
Date: 24 Dec 2013 17:40:01
Message: <web.52ba0c6d2d7d0efacbe7ea7c0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Louis <nomail@nomail> wrote:
> > The last mathemagical example in the tutorial (the saddle) showed off a nice
> > curved shape, and lead me to think that the matrix transform can do some
> > spline-like transforms, like pinch, barrel and maybe even extruding an object
> > into a helix-formed shape, but when experimenting I'm getting confusing results.
>
> Transformation matrices only allow for affine transformations. That's
> transformations where every straight line in the original object
> remains straight after the transformation. (In practice this means
> translations, rotations, scalings, and any combination of those.)
> Thus no twists are possible.
>
> --
>                                                           - Warp

Thanks for clearing that up. I also realized that z.z in my example would be a
constant 1 instead of the z-input into the function. Also, the Saddle example
was using a quadric instead of a cube. It also seems like all parallel lines
will remain parallel, so trapeziums are also impossible to create by
matrix-transforming a cube. The "magic" is slowly disappearing.


Post a reply to this message

From: Louis
Subject: Re: Transforming matrix question
Date: 28 Dec 2013 08:30:01
Message: <web.52bed1c22d7d0efacbe7ea7c0@news.povray.org>
"Louis" <nomail@nomail> wrote:
> I also realized that z.z in my example would be a constant 1 instead of the
> z-input into the function.

I'm confused, will z.z be a constant one in this context, or will it be the the
z- input just like in an ISO-surface-function?


Post a reply to this message

From: clipka
Subject: Re: Transforming matrix question
Date: 28 Dec 2013 09:48:42
Message: <52bee4ca$1@news.povray.org>
Am 28.12.2013 14:27, schrieb Louis:
> "Louis" <nomail@nomail> wrote:
>> I also realized that z.z in my example would be a constant 1 instead of the
>> z-input into the function.
>
> I'm confused, will z.z be a constant one in this context, or will it be the the
> z- input just like in an ISO-surface-function?

Outside functions, "z" is a predefined vector constant evaluating to 
<0,0,1>; thus, "z.z" is the z-component of that vector, i.e. 1.

Inside functions without an explicit parameter list, "z" is the third of 
three parameters, which in an isosurface object will be the z-coordinate 
of whatever point is currently being examined. Note that with function 
parameters always being scalars, "z.z" will generate a parse error when 
used inside such a function.


Post a reply to this message

From: Louis
Subject: Re: Transforming matrix question
Date: 28 Dec 2013 11:45:03
Message: <web.52beff7e2d7d0efacbe7ea7c0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Outside functions, "z" is a predefined vector constant evaluating to
> <0,0,1>; thus, "z.z" is the z-component of that vector, i.e. 1.
>
> Inside functions without an explicit parameter list, "z" is the third of
> three parameters, which in an isosurface object will be the z-coordinate
> of whatever point is currently being examined. Note that with function
> parameters always being scalars, "z.z" will generate a parse error when
> used inside such a function.

Thanks for clearing that up!


Post a reply to this message

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