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)
   z-coordinates
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: z-coordinates  (Read 573 times)
meltphace

Email
z-coordinates
« on: Aug 20th, 2003, 3:07am »

when i run that piece of code,
the lines at the screen don't mean anything :
 
//---------------------------------------
 
void setup() {
  size(200,200);
  background(0);
}
 
void loop() {
  stroke(255);
  line(0,0,0, 0,0,500);
  line(50,0,0, 50,0,1000);
}
 
//-------------------------------------------
 
...and if i just inverse the z-coordinates, then
it yields a correct drawing :
 
//-------------------------------------------
 
void setup() {
  size(200,200);
  background(0);
}
 
void loop() {
  stroke(255);
  line(0,0,0, 0,0,-500);
  line(50,0,0, 50,0,-1000);
}
 
//-------------------------------------
 
is it normal ?
 
benelek

35160983516098 WWW Email
Re: z-coordinates
« Reply #1 on: Aug 21st, 2003, 2:05am »

the lines not being drawn seem to be given a z-value behind the camera... so they are outside the field of view.
 
meltphace

Email
Re: z-coordinates
« Reply #2 on: Aug 22nd, 2003, 3:20pm »

line(0,0,0, 0,0,500);  
line(50,0,0, 50,0,1000);
(this example gives shitty results)
 
the coordinates are all positive.
so they are not behind the camera.
 
am i wrong ?
 
fry


WWW
Re: z-coordinates
« Reply #3 on: Aug 23rd, 2003, 1:09am »

nope, z goes negative:  
 
http://proce55ing.net/reference/environment/index.html#Coordinates
 
you'll want to translate back in z a ways, then draw with positive coords. this comes from opengl.
 
meltphace

Email
Re: z-coordinates
« Reply #4 on: Aug 25th, 2003, 3:49pm »

ok. so i'm very sorry.
in my mind it was clear that z coordinates was
always positive.
 
thanks for the info.
 
...and i won't ask questions like that in the
"software bugs" sections anymore.  
 
fry


WWW
Re: z-coordinates
« Reply #5 on: Aug 25th, 2003, 6:23pm »

on Aug 25th, 2003, 3:49pm, meltphace wrote:
...and i won't ask questions like that in the
"software bugs" sections anymore.  

heh, don't worry about it.. the distinction between bugs and confusing but proper implementation can be vague in programming, but worse with the current state of the Processing release.  
 
so i won't get uppity until the legitimate traffic on the bugs section of the site slows down
 
Pages: 1 

« Previous topic | Next topic »