I’ve succesfuly rotated a rectangle around left-top corner (0, 0) using GL.Rotate and GL.Translate, but rotating around pivot kinda eludes me.
I’m quite keen on theoretical aspects of rotating around pivot point, I know I have to:
- Rotate around default 0, 0 (left-top corner)
- Move it to right and up by the pivot point position - for example: by half the width and height if pivot point was at the center
The problem is, rectangle changes it’s size after rotation (which I know can also be calculated using sin/cos) - but I’ve heard that there is a better solution using matrixes and Matrix.Rotate function.
Looking forward to any suggestions - if it helps, I’m using C# OpenTK.