TheCherno / Sparky

Cross-Platform High Performance 2D/3D game engine for people like me who like to write code.
Apache License 2.0
1.1k stars 223 forks source link

fixed a bug in Orthographic matrix. #131

Open Berzeger opened 7 years ago

Berzeger commented 7 years ago

Judging from this picture: https://www.safaribooksonline.com/library/view/opengl-es-2/9781941222560/images/AspectRatio/OrthographicMatrixDefinition.png, I believe you accidentally flipped the sign at the line I edited.

incognitojam commented 6 years ago

I realise that this pull request is from a while ago, but the code is actually correct. Yan's code is equivalent to that graphic because whilst he swapped the far and near around, he is also 'missing' the minus sign at the beginning. This makes it equal because (as I'm sure you know as well) a double negative makes a positive.

Berzeger commented 6 years ago

The thing is, he didn't swap anything around, he only omitted the minus sign.

incognitojam commented 6 years ago

Oh, sorry, I was reading the wrong side of the diff.

Berzeger commented 6 years ago

No harm done :)