Smooth not working on lines...
in
Programming Questions
•
11 months ago
Hey folks,
I am doing some experiments drawing a grid. When it is
drawn, there seems to be a lot of jaggies and roughness.
I am calling smooth() but it does not seem to make a difference.
Am I missing something?
Anthony
//================================= global vars
int gridDim = 20;
int gridSize = 10;
//================================= init
void setup() {
size(500, 300, P3D);
frameRate(12);
noStroke();
smooth();
}
void clearBackground() {
background(255);
}
void draw() {
clearBackground();
grid(gridSize);
//box(50, 50, 50);
}
void grid(int gSize) {
translate((width/2)-(gridDim*(gridSize/2)), (height/2)-(gridDim*(gridSize/2)));
rotateX(radians(40));
stroke(0);
strokeWeight(1);
for(int i = 0; i < gridDim+1; i++ ) {
line(i*gSize, 0, i*gSize, gridDim*gSize);
line(0, i*gSize, gridDim*gSize, i*gSize);
}
}
I am doing some experiments drawing a grid. When it is
drawn, there seems to be a lot of jaggies and roughness.
I am calling smooth() but it does not seem to make a difference.
Am I missing something?
Anthony
//================================= global vars
int gridDim = 20;
int gridSize = 10;
//================================= init
void setup() {
size(500, 300, P3D);
frameRate(12);
noStroke();
smooth();
}
void clearBackground() {
background(255);
}
void draw() {
clearBackground();
grid(gridSize);
//box(50, 50, 50);
}
void grid(int gSize) {
translate((width/2)-(gridDim*(gridSize/2)), (height/2)-(gridDim*(gridSize/2)));
rotateX(radians(40));
stroke(0);
strokeWeight(1);
for(int i = 0; i < gridDim+1; i++ ) {
line(i*gSize, 0, i*gSize, gridDim*gSize);
line(0, i*gSize, gridDim*gSize, i*gSize);
}
}
1