i want to make a chart of dots with PGraphics but the last colum and row always disapear.
i want it to be dinamic and varieate the ise of the grid depending on the size of the window
but it always seem to eat the last colum and row
any change i can do jut to make it apear? it doesnt have to be exactly the distance in that las one, just make it apear
PGraphics pg;
float origin=0;//just if i want to change the start of the grid
float dotx=origin;
float doty=origin;
//where i gues is the roblem
int col=int (width/100); //=6 colums 7 dots
int row=int (height/100); //=6 rows 7 dots
float dx= width/col; //distance between point in x axis
float dy= height/row; //distance between point in y axis
void setup() {
size(600, 600);
pg = createGraphics(600, 600);
pg.beginDraw();
pg.background(100);
pg.stroke(255);
pg.endDraw();
noLoop();
}
void draw() {
pg.beginDraw();
pg.strokeWeight(4);
//table creation
for (doty=origin;doty<height;doty+=dy){
for(dotx=origin;dotx<width;dotx+=dx){
pg.point(dotx,doty);
}
}
}
PD: i guess its because the point ends outside of the window and doesnt bother to draw it