Skip to content

Instantly share code, notes, and snippets.

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/19f9a9663ae67eaca191aa7a6be558f9 to your computer and use it in GitHub Desktop.
Save companje/19f9a9663ae67eaca191aa7a6be558f9 to your computer and use it in GitHub Desktop.
Load WorldMap .OBJ with adjusted perspective (Basic Perspective Sphere)
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