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 › Why shows this code a dot instand of 2 lines
Page Index Toggle Pages: 1
Why shows this code a dot instand of 2 lines (Read 365 times)
Why shows this code a dot instand of 2 lines
Mar 22nd, 2009, 5:10pm
 
This code ends up with a dot at 20,20 ut I expect it to be 2 lines. What am I doing wrong? (I know I can use vertex(20,0) etc. and then it works but I have to use translate becuase of the next thing I go to do.)

noFill();

beginShape();
vertex(0,0);
translate(20, 0);
vertex(0,0);
translate(0, 20);
vertex(0, 0);
endShape();
Re: Why shows this code a dot instand of 2 lines
Reply #1 - Mar 22nd, 2009, 8:14pm
 
Not sure why, so I will just do a guess: translate applies to the shape as a whole, but vertex calls are inside the shape, then are unaffected by translate (or scale, rotate, etc., I suppose).
Re: Why shows this code a dot instand of 2 lines
Reply #2 - Mar 22nd, 2009, 10:55pm
 
as far as i know it wont work this way. what you do is just drawing 3 points at 0,0...
Page Index Toggle Pages: 1