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 & HelpOpenGL and 3D Libraries › Artifacts in P3D "Line Matrix"
Page Index Toggle Pages: 1
Artifacts in P3D "Line Matrix" (Read 344 times)
Artifacts in P3D "Line Matrix"
Feb 9th, 2008, 5:56pm
 
Hi. I'm trying to make this 3D matrix made of lines, which I thought would be pretty easy to do.

I managed to build it correctly, although when using the camera() function to rotate around I get strange artifacts at certain positions.

Could anyone help me out as of why this is happening and/or how can I fix the camera rotation so it goes around the object?

Thanks a lot.

Here's the code

////////////////
void setup(){
 size(640,480,P3D);
 stroke(0);
 
}

void draw(){
 camera(mouseX,mouseY,0.0, width/2,0.0,0.0, 0.0,1.0,0.0);
 background(255);
 
 int x=0,y=0,z=0;
 for(x=0;x<300;x+=20){
   for(y=0;y<100;y+=20){
    for(z=0;z<100;z+=20){
     line(x,y,z, x,y+2,z);
    }
   }
 }  
}


**EDIT**
Sometimes even an IndexOutOfBounds Exception shows up in " line(x,y,z, x,y+2,z); ", although I haven't been able to figure out why.

:/
Page Index Toggle Pages: 1