You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want rotate an object from it's own center and I used TransformManger to rotate the object. It seems that the rotation center is not the center of the object. (basically like self rotation in solar system)Do I have to move the object to (0,0,0) and perform the rotation and the move it back to achieve the goal?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want rotate an object from it's own center and I used TransformManger to rotate the object. It seems that the rotation center is not the center of the object. (basically like self rotation in solar system)Do I have to move the object to (0,0,0) and perform the rotation and the move it back to achieve the goal?
Matrix.setRotateM(transformMatrix, 0, Math.toDegrees(degreeZ).toFloat(), 0.0f, 0.0f, 1.0f)
val tcm: TransformManager = engine.getTransformManager()
scene.addEntity(renderable)
tcm.setTransform(tcm.getInstance(renderable), transformMatrix);
These are the code and thanks so much!
Beta Was this translation helpful? Give feedback.
All reactions