POV-Ray : Newsgroups : povray.pov4.discussion.general : superlinear transformations : Re: superlinear transformations Server Time
30 Apr 2024 02:14:50 EDT (-0400)
  Re: superlinear transformations  
From: Dan Connelly
Date: 26 Sep 2008 20:46:33
Message: <48dd8269$1@news.povray.org>
Warp wrote:
> Dan Connelly <djc### [at] yahoocom> wrote:
>> Presently, objects can be transformed according to a displacement
>> vector plus a 3x3 matrix.  This is a linear transformation.  However,
>> it would be useful if one could also do nonlinear transformations.
>> For example, x -> x * y, or x -> x * (1 + 0.1 * sin(y)).  I can easily
>> see how this would become hopelessly complex, but it would be useful.
> 
>   Actually objects are not transformed at all. That would be impossible
> in the generic case.
> 
>   What POV-Ray does is a common raytracing trick: Rather than transform
> the object with the transformation matrix, it transforms the ray with
> the inverse of the transformation matrix. The end result is exactly the
> same, but the advantage is that it's much easier (and in many cases,
> *possible*) to do it like this.
> 
>   This is the reason why transformations must be linear. The straight ray
> must be straight also after it's transformed. It cannot become curved.
> This is the reason why only rotation, scaling, skewing (which is actually
> a combination of rotation and uneven scaling) and translation is possible.
> 
>   Raytracing with curved lines cannot be done accurately, and would be
> extremely slow.
> 


Excellent answer -- thanks.

I'm a bit confused about the skew argument.  There's

matrix:

3 degrees of freedom: transformation
3 degrees of freedom: scaling
3 degrees of freedom: rotation

So this leaves 3 more degrees of freedom..... which are skew.


(right-hand coordinates)

| ax  0  0 |
| 0  ay  0 | : scaling
| 0  0  az |

| cz  sz  0 |

| 0   0   1 |   (permute for x, y)

So between scaling and rotation, I'm constrained to
antisymmetric matrixes.

A typical shear matrix:

| uz  vz  0 |

| 0   0   1 |   (permute for x, y)

So this gives me 9 parameters:
ax, ay, az, sx, sy, sz, vx, vy, vz

the same number of parameters needed to specify the full matrix.


Post a reply to this message

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