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
   Programs
(Moderators: fry, REAS)
   beginShape(LINE_STRIP)
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: beginShape(LINE_STRIP)  (Read 1559 times)
flight404

WWW Email
beginShape(LINE_STRIP)
« on: May 23rd, 2004, 5:47am »

Having an issue that I cannot wrap my head around.
 
http://www.flight404.com/p5/radial_0/
 
The problem in question is that the strokes should get darker the further away they get from the center of the spikeBall.
 
Code:

 
beginShape(LINE_STRIP);
 
// set color for first point to be white
stroke(255);
 
// set position of first point to be the center of the 3D space
vertex(0,0,0);
 
// set color for the last point to be black
stroke(0);
 
// set position of last point to be a specific distance from the center
vertex(0,0,50);
 
endShape();
 

 
For some reason, if the line exists to the left of center, the stroke inverts somehow.  Might it be a facet of the beginCamera() code that I am not aware of?  I searched around but couldn't find any relevant posts.  Thoughts?
 
 
TomC

WWW
Re: beginShape(LINE_STRIP)
« Reply #1 on: May 23rd, 2004, 9:46pm »

Not sure how you're drawing code works - one too many layers of misdirection for a Sunday night
 
Have you managed to reproduce that problem with more minimal code?
 
What does your camera code do to this?
 
Code:

 
int   NUM_SPOKES   = 36;
float SPIKE_LENGTH = 125.0;
 
void setup() {
  size(400,300);
}
 
void loop() {
   
  background(0);
   
  translate(width/2,height/2);
  rotateY(TWO_PI*mouseX/width);
  rotateZ(TWO_PI*mouseY/height);
 
  for (int i = 0; i < NUM_SPOKES; i++) {
    push();
    rotateX(i*TWO_PI/NUM_SPOKES);
    beginShape(LINE_STRIP);
    stroke(0);
    vertex(0,0,0);
    stroke(255);
    vertex(0,0,SPIKE_LENGTH);
    endShape();
    pop();
  }
   
}
 

 
(edited code to make the method similar to the original)
« Last Edit: May 23rd, 2004, 9:53pm by TomC »  
flight404

WWW Email
Re: beginShape(LINE_STRIP)
« Reply #2 on: May 23rd, 2004, 9:56pm »

Same result.  The lines to the left of center seem to draw from the outside->in and the others, inside->out.  Is there some rule that beginShape() draws from the left to the right?  I can't imagine that would be the case.  
 
Should this be filed as a bug is the question.
 
arielm

WWW
Re: beginShape(LINE_STRIP)
« Reply #3 on: May 23rd, 2004, 10:29pm »

pasted TomC's simplified test-case into version 0066 (the highest installed on my machine) and it behaves as intended (all the rays are darker towards the center of the round)
 
robert: which version do you use?
 

Ariel Malka | www.chronotext.org
flight404

WWW Email
Re: beginShape(LINE_STRIP)
« Reply #4 on: May 23rd, 2004, 10:58pm »

I am on v69.  OSX 10.3.1.  
 
 
UPDATE----------------
Here is what I see when I paste Tom's code directly into v69 Processing without using the camera method (which I guess isn't part of the problem).
 
http://www.flight404.com/p5/radialProblem.gif
« Last Edit: May 23rd, 2004, 11:49pm by flight404 »  
arielm

WWW
Re: beginShape(LINE_STRIP)
« Reply #5 on: May 23rd, 2004, 11:51pm »

filled this bug report:
http://processing.org/discourse/yabb/board_Proce55ing_software__bugs_action_display_num_1085348942_.html
 
let's continue this thread from there...
 

Ariel Malka | www.chronotext.org
Pages: 1 

« Previous topic | Next topic »