-
-
Save reidblomquist/4ceb1bd3d380a2c33c33 to your computer and use it in GitHub Desktop.
constantly rotating; needs to mimic rotation of accelerometer and stop
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
// accx, accy, and accz are all float vals from a 3-axis accelerometer | |
// how can i make this camera simply mimc the accelerometers position on a quaternion slerp | |
// Sample data: onNewMessage, message: DATA, x, 0.26, y, 0.06, z, -0.95, Range, +-8g | |
curRot = ofQuaternion(accx, cam.getXAxis(), accy, cam.getYAxis(), accz, cam.getZAxis()); | |
cam.setPosition((cam.getGlobalPosition()-mesh.getCentroid())*curRot +mesh.getCentroid()); | |
cam.rotate(curRot); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment