Answer the question
In order to leave comments, you need to log in
How to make three sf::RectangleShape objects line up (sfml library, c++ language)?
I need three objects to rotate as one. That's how it should be , and that's how it turns out . That is, instead of being rotated as one object, the three objects are rotated separately. Getting to the point, I need to find x2, y2 if x1, y1, width, height and rotation angle are known. Here is the drawing. In the answer I would like to see the formula.
Answer the question
In order to leave comments, you need to log in
Hook your rectangles into a hierarchy and rotate the parent.
You need to rotate not around the center of the object, but around the axis of rotation. In this case, the axis of rotation passes outside the objects.
If transformation matrices are used, then first you need to move, then rotate, and not first rotate and then move.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question