anton.stetz Posted March 19, 2013 Share Posted March 19, 2013 Hi all. I have widgetSprite. I added the layer. Using WidgetSprite::setLayerTransform I rotate it. sprite_env_but.setLayerTransform(1, rotateZ(30.0f*sl_environment.getValue())); But it takes a pivot point in the upper left corner. How to rotate around its center? Thanks. Link to comment
ulf.schroeter Posted March 19, 2013 Share Posted March 19, 2013 Try providing combined trans-rot-inverse-trans-matrix e.g. translate( vec3( 0.5f, 0.5f, 0.0f ) ) * rotateZ() * translate( vec3( -0.5f, -0.5f, 0.0f ) ) Link to comment
anton.stetz Posted March 19, 2013 Author Share Posted March 19, 2013 Cool! Thanks Ulf! Link to comment
Recommended Posts