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_
   Bugs
   Software Bugs
(Moderator: fry)
   strokeWidth() and rotateX,rotateY
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: strokeWidth() and rotateX,rotateY  (Read 2730 times)
scrap-pile

WWW
strokeWidth() and rotateX,rotateY
« on: Jul 23rd, 2003, 4:57am »

I'm noticing that when i set strokeWidth higher than 1, and apply a rotateX or rotateY transformation my lines become invisible.
 
has anyone else noticed this? am i doing something wrong?  
 
here's the code i was using to test this out:
 
 
void setup(){  
  size(300,300);
  noBackground();
  fill(255);
  rect(0,0,width,height);
}
void loop(){
  translate(width/2, height/2);
  //
  //rotateY(PI/3.0);
  //rotateX(PI/3.0);
  //rotateZ(PI/3.0);
  //
  stroke(255,0,0);
  strokeWidth(5);
  line(-100,-100,100,100);
  //
  stroke(0,255,0);
  strokeWidth(3);
  line(-100,100,100,-100);
  //
  stroke(0,0,255);
  strokeWidth(1);
  line(-100,0,100,0);
}
 
arielm

WWW
Re: strokeWidth() and rotateX,rotateY
« Reply #1 on: Jul 23rd, 2003, 4:38pm »

with 056, i could draw thick lines in 3d but i guess there's a very strange bug somewhere!
 
i did the following, based on your test-case (i removed the noBackground stuff since it's not related).
 
Code:

// test-case for: strokeWidth doesn't always work in 3d
// press the mouse to have a x rotation...
 
float a;
 
void setup()
{  
  size(300,300);  
}
 
void loop()
{
  translate(width/2, height/2);  
  rotateZ(a);
  a += radians(1.0f);
 
  // STRANGE: WITHOUT "MOUSEPRESSED", IT WON'T WORK ?!?
  if (mousePressed)
  {
    rotateX(radians(60.0f));
  }
 
  stroke(255,0,0);  
  strokeWidth(5);  
  line(-100,-100,100,100);  
  //  
  stroke(0,255,0);  
  strokeWidth(3);  
  line(-100,100,100,-100);  
  //
  stroke(0,0,255);  
  strokeWidth(1);  
  line(-100,0,100,0);
}

notes:
- strokeWidth() works well in plain 2d
- works also when a z rotation alone is applied
- *sometimes* works when a x or y rotation is applied
 
in this test-case, when pressing the mouse, it will apply a x rotation and the thick line will still show, but the strange thing is that if you remove the "if (mousePressed)" part and let the "rotateX" alone, it won't work!?
 
ben?
 

Ariel Malka | www.chronotext.org
fry


WWW
Re: strokeWidth() and rotateX,rotateY
« Reply #2 on: Jul 23rd, 2003, 9:37pm »

hrm.. line troubles. this will be moot once carlos and sami have redone the lines and rendering stuff. hopefully that'll be in the next release, but it should be soon at any rate. for the time being will you be able to work around it (perhaps with a.. gulp.. hack?)
 
elout

12747371274737 WWW
Re: strokeWidth() and rotateX,rotateY
« Reply #3 on: Sep 19th, 2003, 1:01pm »

Encountered this line-drawing 'bug/feature' today as well.
 
Code:

void setup()
{
  size(400,400);
  stroke(1, 1, 1);  
  //strokeWidth(2);
  noFill();
  background(200, 200, 200);
  lights();
}
 
void loop()
{
  translate(width/2, height/2, mouseY-150.0);
  rotateX(mouseX/100.0);
  rotateY(mouseY/100.0);
  rotateZ(mouseY-mouseX/100.0);
   
  for (int i=0;i<140;i++){
   box(random(200), random(200), random(200));
  }
}

 
 
note; if you set  
stroke(0, 0, 0);
it works
 
or if you disable lights();
it works
 
But if you use
strokeWidth(2);
this nice blurring start again.
 
p5_0059 - w98
 
Pages: 1 

« Previous topic | Next topic »