2016年12月1日木曜日

openFrameworks 画像の角度をカエル

ofPushMatrix(); //こっから
ofTranslate(x+w/2.f, y+h/2.f, .0f);
ofRotateZ(this->rotation); //ここに角度を入れる
ofTranslate((x+w/2.f)*-1.f, (y+h/2.f)*-1.f, .0f);
myImage.draw(x, y);
ofPopMatrix(); //ここまでのものに適用させる

参考url:: https://forum.openframeworks.cc/t/ofimage-mirror-amp-rotate-functionality/1716/9

ofimageではrotate90メソッドで回転できるけど90度づつ限定なので、小回りきかない
これで角度指定して回せる