How to rotate image?

I found a function named rotate90();
But I want to rotate 30 degrees.How could I do it?

Hi there!

rotate90() does a pixel operation. That is, it actually rearranges the order of the pixels. So that if you have a landscape image, apply the rotate90 and save it, you’ll save it as an portrait image.

If this is what you want, then you’ll have to do it yourself for 30 degrees. And you’ll need to add some “blank” pixels.

On the other hand, if you just want to change/rotate the display, you can use matrix operations. For example:

ofRotateX(30);

Or:

ofRotate(30, 1.0, 0.0, 0.0);

If you have other objects, don’t forget to do Push/Pop, so that you don’t apply it to everything. :slight_smile: