We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Skew transformation
Page Index Toggle Pages: 1
Skew transformation? (Read 1028 times)
Skew transformation?
Jan 26th, 2006, 2:50pm
 
hello!

is there a way to perform a skew transformation? e.g. to do this transformation:

-----
|   |
-----

to

  -----
 /     /
-----



thanks!
fabian Smiley
Re: Skew transformation?
Reply #1 - Jan 26th, 2006, 3:07pm
 
find the matrix for skew (sheer) somewhere on the web and then apply via applyMatrix(). i don't know it offhand but i know it's simple to do.
Re: Skew transformation?
Reply #2 - Jan 26th, 2006, 3:33pm
 
ah, i see - sounds like it'll work out Smiley

thanks!
fabian
Re: Skew transformation?
Reply #3 - Jan 26th, 2006, 3:35pm
 
Maybe this is enough?

Code:

int[] point1, point2,point3 ,point4;
void setup(){
size(300,300);
point1=new int[]{
10,10 };
point2=new int[]{
30,10 };
point3=new int[]{
30,30 };
point4=new int[]{
10,30 };
}
void draw(){
background(255);

beginShape();
vertex(point1[0]+mouseX,point1[1]);
vertex(point2[0]+mouseX,point2[1]);
vertex(point3[0],point3[1]);
vertex(point4[0],point4[1]);
vertex(point1[0]+mouseX,point1[1]);
endShape();
}

Page Index Toggle Pages: 1