Hello
I’m kinda new to the community so i hope this is the right place to ask.
I played a little with 3D Chaos game to create fractals, while doing so i tried to make a 2d shape in 3d space made of dots.
I was surprised to see that i get different patterns in the 2d shape while zooming.
Does anyone knows why this is happening? maybe it has something to do with PeasyCam itself or computer graphics in general? I just find it interesting so id like to know.
here is an example:
and my code:
import peasy.*;
PeasyCam cam;
PVector[][] globe;
PVector[][] colo;
int total = 400;
int r = 200;
int flag = 0;
void setup() {
size(600, 600, P3D);
cam = new PeasyCam(this, 500);
globe = new PVector[r+1][(r+1)];
colo = new PVector[r+1][(r+1)];
createChaos();
}
void draw() {
background(0);
stroke(255);
if (flag == 1)
{
for (int i = 0; i <= r; i++) {
for (int j = 0; j <= (r-i); j++) {
stroke(colo[i][j].x,colo[i][j].y,colo[i][j].z);
point(globe[i][j].x,globe[i][j].y,globe[i][j].z);
}
}
}
}
void createChaos(){
float x = 0;
float y = 0;
float z = 0;
int i,j,k = 0;
int a = 0,b = 0,c = 0;
for (i = 0; i <= r; i++) {
for (j = 0; j <= r-i; j++) {
a = 255;
b = 0;
c = 0;
globe[i][j] = new PVector(x, y, z);
colo[i][j] = new PVector (a,b,c);
k++;
x = i;
y = j;
}
k = 0;
}
flag = 1;
}