Jypeli-JYU / Jypeli

A simple educational C# game programming library built on top of Silk.NET.
24 stars 4 forks source link

Fix transformation bug in ScreenView.ToXnaCoords #14

Closed Anttifer closed 4 years ago

Anttifer commented 4 years ago

The conversion of transformation matrices from game coordinates to screen coordinates didn't work properly for matrices with a rotation component.

Pure translations worked fine, but if any object – for example a window or a button – with attached labels was rotated, the label transformations would make absolutely no sense.

Both Label and LetterPicker tried to apply a correction for this by inverting the rotation angle, but this only worked if the labels had no parent transformation (hardly ever, that is), and even then only partially, since the rotation centre would still be slightly wrong.