Looking to get a shape to always face a ofCamera. Here is a basic example, at some point the circle is flipped and not working anymore. Is there a simple better way to make this happen?
ofEasyCam cam;
//--------------------------------------------------------------
void ofApp::setup(){
cam.setDistance(80);
}
//--------------------------------------------------------------
void ofApp::update(){
}
//--------------------------------------------------------------
void ofApp::draw() {
ofVec3f rot = cam.getOrientationEuler();
cam.begin();
ofNoFill();
ofSetColor(255);
ofDrawBox(25);
ofPushMatrix();
ofTranslate(2, 2);
ofRotateX(rot.x);
ofRotateY(rot.y);
ofRotateZ(rot.z);
ofFill();
ofSetColor(255, 0, 0);
ofDrawCircle(0, 0, 0, 2);
ofPopMatrix();
cam.end();
}