Rotating a loaded 3D model

Hi there. I am using ofxAssimpModelLoader to load in a .obj file.

As the docs say I am using model.setRotation(0,90,0,1,0); to turn the model towards the camera. I am trying to understand how I can now now SPIN the model in a clockwise fashion while facing the camera. I have tried the following assuming I am trying to rotate the Y axis.

int dynamicrotate = 0

void ofApp::draw(){

   model.setRotation(0,90,0,dynamicrotate,0);
   model.drawFaces();
   dynamicrotate++;

}

Should I be using the same setrotation as the one to face the model to the camera or should I be doing something else?

Thanks for your help.

Fixed with…

model.loadModel("prop2.stl");
model.setPosition(0, 0, 0);
model.setRotation(0,90,1,0,0);
model.setScale(0.8, 0.8, 0.8);

ofPushMatrix();
ofTranslate(ofGetWidth()*.5, ofGetHeight()*.5, 0);
easycam.begin();
ofRotateZ(windrot);
model.drawFaces();
easycam.end();
ofPopMatrix();
1 Like