Philip-Trettner / GlmSharp

Open-source semi-generated GLM-flavored math library for .NET/C#
MIT License
47 stars 18 forks source link

there is a bug in the mat4.Perspective() method #4

Closed vbelcik closed 8 years ago

vbelcik commented 8 years ago

This relates to the method: public static mat4 Perspective(float fovy, float aspect, float zNear, float zFar) in the mat4 struct. line: var m = Identity; should be: var m = Zero; otherwise perspective shifts the eye some distance back, at least the result seems like that when applied in the simple scene where world distance unit (1) occupied 1/5 of a window size. Note: mat4.PerspectiveFov() method lacks this bug

Philip-Trettner commented 8 years ago

Thanks for spotting that. I rechecked the original glm code and it has a zero initialisation there as well.

Fixed in 619d8fc