Page 1 of 1

skew transformation

Posted: Sun Mar 20, 2011 4:08 pm
by hermitko
Hi,

I am new here, experimenting with CF. BTW great stuff, thanks to all creators.

I'm wondering how exactly skew transformation works. I didn't found it anywhere, but I'm confused. Why

Code: Select all

skew -1 1
is not the same as

Code: Select all

r 1
?
Instead, some little scaling is also applied, try:

Code: Select all

startshape xx
rule xx{
  CIRCLE{}
  xx{skew 1 -1 x 1}
}
And another one:

Code: Select all

startshape pom

background {b -1}

rule pom{
CIRCLE{s .02 sat 1 b 1}
pom{x .05 s .99 1 r 5 skew -1 19 h 189}
}
How it's possible, that in each layer of the spiral there is almost perfect circle? Shouldn't it be skewed more and more and produce ellipses with bigger relative excentricity?

Can anyone help me? Thx H.

Re: skew transformation

Posted: Sun Mar 20, 2011 7:36 pm
by MtnViewJohn
Composition of affine transforms is very hard to understand. Especially for affine transforms that are not similarity transforms (skew and anisomorphic scaling). Mark wrote a lesson in affine transforms a few years ago: http://www.glyphic.com/transform/

Re: skew transformation

Posted: Mon Mar 21, 2011 3:55 am
by hermitko
Thank you for responding, but this doesn't help me out of my confusion. Let's put it another way: What is the transformation matrix for skew transform? Or: What is preserved when skewing (definitely not the axes scales - see my first example)?

Re: skew transformation

Posted: Mon Mar 21, 2011 1:04 pm
by MtnViewJohn

Code: Select all

[   1.0   tan(y)   0.0 ][x] [x']
[ tan(x)   1.0     0.0 ][y]=[y']
[   0.0    0.0     1.0 ][1] [1]
All of the affine transforms can be found in the source file src-agg/include/agg_trans_affine.h

Re: skew transformation

Posted: Mon Mar 21, 2011 2:39 pm
by hermitko
Thank you very much...