Thanks for answering,
I knew there was a word for it but yeah, it front-clips (don't know if it's a verb though :) the geometry up to a certain point in front of the camera so you can never really zoom in to a single point. Switching to P3D solves this but then i would have to do with all the gl-niceties so i'd rather stick to opengl if possible and P3D seems to have it's own other issue. No front clipping but instead if you zoom in too close geometry is getting mirrored. I've also added a screenshot to show what goes on, weird...
Thanks,
FRid
- import processing.opengl.*;
import peasy.test.*;
import peasy.*;
PeasyCam cam;
int amount = 50;
int locatie = (amount/2)*-1;
punt[][] mijnPunt = new punt[amount][amount];
void setup() {
size(500,500,OPENGL);
//size(500,500,P3D);
cam = new PeasyCam(this, 50);
cam.lookAt(0,0,0);
for (int i=0;i<amount;i++) {
for (int j=0;j<amount;j++) {
mijnPunt[i][j] = new punt(locatie+i,locatie+j,0);
}
}
}
void draw() {
background(0);
mijnPunt[25][25].c = color(255,0,0);
for (int i=0;i<amount;i++) {
for (int j=0;j<amount;j++) {
mijnPunt[i][j].run();
}
}
}
void keyPressed() {
if (key == ' ') {
saveFrame("Example-###.jpg");
}
}
class punt {
PVector loc;
color c = color(255);
punt(float _x, float _y, float _z) {
loc = new PVector(_x,_y,_z);
}
void run() {
display();
}
void display() {
stroke(c);
point(loc.x,loc.y,loc.z);
}
}
This happens when using P3D, you have to tilt the grid as if it were a surface and the camera is floating above it to recreate the effect.