Created
March 25, 2024 01:03
-
-
Save companje/c434f5046ae658be42f39370f2feeef3 to your computer and use it in GitHub Desktop.
Orientate circle on 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
//... | |
PVector axis = PVector.cross(lens, new PVector(0, 0, -1), null); | |
float angle = PVector.angleBetween(lens, new PVector(0, 0, 1)); | |
pushMatrix(); | |
rotate(angle, axis.x, axis.y, axis.z); | |
translate(0, 0, height/2-3); | |
noFill(); | |
stroke(0); | |
strokeWeight(5); | |
hint(DISABLE_DEPTH_TEST); | |
circle(0, 0, 2*lens.radius*height/2); | |
hint(ENABLE_DEPTH_TEST); | |
popMatrix(); | |
//... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment