skew transformation

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
hermitko
Posts: 3
Joined: Fri Mar 18, 2011 5:19 pm

skew transformation

Post 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.
Last edited by hermitko on Mon Mar 21, 2011 3:50 am, edited 1 time in total.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: skew transformation

Post 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/

hermitko
Posts: 3
Joined: Fri Mar 18, 2011 5:19 pm

Re: skew transformation

Post 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)?

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: skew transformation

Post 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

hermitko
Posts: 3
Joined: Fri Mar 18, 2011 5:19 pm

Re: skew transformation

Post by hermitko »

Thank you very much...

Post Reply