Open CdTCzech opened 9 years ago
[1] http://www.songho.ca/opengl/gl_projectionmatrix.html seems to be right in his code
Hi CdTCzech,
Thanks for your issue. I'll definitely take a look at that vector issue, since that obviously wasn't my intention.
Regarding the matrix issue: both methods are correct, and will yield the same result.
-(far + near) / (far - near)
and (far + near) / (near - far)
are the same.
Hi Cherno, Thanks for great series and sorry for my bad English. I'm actually at episode 6. But after I watched episode 5(.5) think that I found one issue and one inconsistency in your code which can be "weird" for begginers.
[1] Issue in mat4.cpp in orthographic method. In all your branches you have:
The problem is, I think, in line:
Because "original" is
So your line should be:
[2] There is inconsistency in your code. I know - it is because of union which works only with PODs.
vec2 and vec3 have void parameter constuctor defined to fill these vectors with zeroes. vec4 have this constructor set as "= default". So your struct variables are uninitialized.
So if you have:
Than aa and bb is zeroes. But if you try this (in VS 2015 RC in my case):
You will get compile time error:
Of course you can still get c filled with zeroes. For example like this:
To fix this you can set constructors of vec2 and vec3 to "= default" as well or instead of union use casting or... whatever - it is totally up to you.
Thanks, and have a nice day, CdTCzech