I am trying to rotate a 3d cylinder by 90 degrees but cannot find how. Can anyone give me an example on how to use rotateAroundDeg to do this?
Many thanks
I am trying to rotate a 3d cylinder by 90 degrees but cannot find how. Can anyone give me an example on how to use rotateAroundDeg to do this?
Many thanks
Hi @vestus,
I think if you try to use something like ofRotateXDeg, it should work.
So assuming you have an cylinder, you can write something like this:
in ofApp.cpp::draw()
ofCylinderPrimitive cylinder;
cylinder.set(10, 2.2);
ofPushMatrix();
ofRotateXDeg(90);
cylinder.draw(200,290);
ofPopMatrix();
It’s best practice to use ofPushMatrix() and ofPopMatrix(), as the transformation will only apply to what’s inbetween them.
Hope this helps,
++
P