Skip to content

Instantly share code, notes, and snippets.

@companje
Created February 28, 2024 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save companje/c3ec1635c58253fc1d729e7016856107 to your computer and use it in GitHub Desktop.
Save companje/c3ec1635c58253fc1d729e7016856107 to your computer and use it in GitHub Desktop.
Load WorldMap .OBJ with adjusted perspective
PShape globe;
float w,h,eyeZ;
void setup() {
fullScreen(P3D);
w = width;
h = height;
eyeZ = 1460; // = h/2 + offset
globe = loadShape("1519/159.obj");
globe.scale(h/2);
globe.rotateX(PI);
}
void draw() {
background(0);
perspective(atan(h/2/eyeZ)*2, w/h, eyeZ, eyeZ*2);
camera(0, 0, -eyeZ, 0, 0, 0, 0, 1, 0);
scale(-1,1,1);
rotateY(mouseX*.01); //-frameCount*.0025);
rotateX(mouseY*.01); //-frameCount*.0025);
shape(globe);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment