FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   field
« Previous topic | No topic »

Pages: 1 
   Author  Topic: field  (Read 596 times)
Martin

122417302122417302martingomez_listsmg1ph WWW Email
field
« on: Aug 27th, 2002, 3:03pm »

hi. just finished midterms. can now delve into proce55ing.
 
just a review of dbn... what's the syntax in using 'field'? now on to proce55ing, is there a similar instruction?
 
thanks.
 
cheers!
 
Martin

122417302122417302martingomez_listsmg1ph WWW Email
Re: field
« Reply #1 on: Aug 27th, 2002, 5:13pm »

hi again.
 
i managed to figure out the syntax of the dbn field instruction. lol. hehe. and an easy way out / alternative if i'm gonna do it in p5 ... just a combo of noStroke() and rect()... hehe. oh well... (but really... are there any hidden features in p5? hehe... easter eggs? )
 
thanks.
 
fry


WWW
Re: field
« Reply #2 on: Sep 1st, 2002, 10:19pm »

the difference being that the stroke is set to black and the fill is set to white when you start with a blank slate in p5 (also the background is set to a gray). this is best for folks just starting. to make your own field function in p5, something like this is overkill, but should work in all situations (i.e. if you've set the colorMode or rectMode already)
 
void field(float x1, float y1, float x2, float y2, float gray) {
  colorMode(RGB, 100);
  rectMode(CORNERS);
  fill(gray);
  noStroke();
  rect(x1, y1, x2, y2);
}
 
of course, don't interpret this as "proce55ing is more complex than dbn", it's just that the field function was somewhat poorly designed (no means for border or color) and p5 is meant to allow for slightly more advanced things.  
 
as for easter eggs, there are likely to be plenty, but mostly attributable to bugs and undocumented features (such a fine line between these two)
 
Pages: 1 

« Previous topic | No topic »