Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save duskvirkus/c3752a76ce5d5f40744b162ff2b991ad to your computer and use it in GitHub Desktop.
Save duskvirkus/c3752a76ce5d5f40744b162ff2b991ad to your computer and use it in GitHub Desktop.
Some interesting accidental camera movement in openFrameworks.
// in ofApp.h
float angle;
float cameraDistance;
ofCamera camera;
// in setup
angle = 0;
cameraDistance = 100;
// function
void ofApp::updateCamera() {
camera.setPosition(cameraDistance * sin(angle), cameraDistance * sin(angle), 100);
camera.lookAt(ofVec3f(0, 0, 0));
angle += 0.01;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment