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