Closed Payotz closed 7 years ago
Hey, it has been a while and I've never really used glm. GLM prints out the values (and stores them) Column Major where as gl3n does it Row Major, that explains the differences in 3).
Regarding 4) Gl3n scales by multiplying the matrix (A) with a scaling matrix (B) on the left side B * A
, where as it seems glm does a A * B
, scaling matrix on the right side.
gl3n does it that way, because it allows you to chain operations more naturally, since the operations happen in the order you chain them (first rotate, then apply the scale to this result).
Sorry that it took so long to answer, at first glance it looked really complicated so I postponed for a bit.
Sorry for the late reply. I was out of town. Thank you. I understand what's the issue now.
So basically, I'm trying to replicate what I've written in C++ into Dlang.
I have this as the Dlang code.
And this as the C++ code:
And the results are different:
Dlang code:
C++ code:
At first, the values are basically the same, then it starts to differ at the third output.
Dlang code:
model = model.translate(vec3(-0.5f * size.x, -0.5f * size.y, 0.0f))
C++ code:
model = glm::translate(model,glm::vec3(-0.5f * size.x, -0.5f * size.y, 0.0f))
I'm not sure if this is a bug or not, I just don't know where to post it. I am probably doing something wrong here, but I'm still trying to wrap my head around matrices in general. If this is not a bug, then I'm very sorry for wasting your time.