Created
February 28, 2024 22:40
-
-
Save companje/c3ec1635c58253fc1d729e7016856107 to your computer and use it in GitHub Desktop.
Load WorldMap .OBJ with adjusted perspective
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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