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 › making the the stroke of an object bigger.
Page Index Toggle Pages: 1
making the the stroke of an object bigger. (Read 760 times)
making the the stroke of an object bigger.
Jul 29th, 2007, 12:34am
 
how do i make the stroke of a box() or rect() etc wider/bigger? the strokeWeight() only works with the line() object.
Re: making the the stroke of an object bigger.
Reply #1 - Jul 29th, 2007, 2:06am
 
see the first two comments for the bug report
http://dev.processing.org/bugs/show_bug.cgi?id=123
for an explanation of 1) why strokeWeight doesn't exist in 3D, and 2) a workaround.
Re: making the the stroke of an object bigger.
Reply #2 - Jul 29th, 2007, 4:05am
 
It is also possible to fake a shape's stroke by drawing another similar object with at the same position/angle, with a different size and color.

e.g, these very simple workarounds. Smiley

Quote:
int Stroke = 100;
int Rectsize = 40;
void setup(){
 size(500,500,P3D);
 frameRate(30);
noStroke();
}

void draw(){
 background(0);
 fill(100);
 rect(mouseX-Stroke/2,mouseY-Stroke/2,Rectsize+Stroke,Rectsize+Stroke);
 fill(255);
 rect(mouseX,mouseY,Rectsize,Rectsize);
}


Quote:
int Stroke = 100;
int Ellipsesize = 20;
void setup(){
 size(500,500,P3D);
 frameRate(30);
noStroke();
}

void draw(){
 background(0);
 ellipseMode(CORNER);
 fill(100);
 ellipse(mouseX-Stroke/2,mouseY-Stroke/2,Ellipsesize+Stroke,Ellipsesize+Stroke);

 fill(255);
 ellipse(mouseX,mouseY,Ellipsesize,Ellipsesize);
}
Re: making the the stroke of an object bigger.
Reply #3 - Jul 31st, 2007, 10:38am
 
beautiful.. thanks!
Page Index Toggle Pages: 1