Commit 0f879a83 authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'master' of cgogn:CGoGN

parents 5d7f0623 2023e6b7
...@@ -70,28 +70,32 @@ public: ...@@ -70,28 +70,32 @@ public:
void rotate(float angle, const Geom::Vec3f& Axis) void rotate(float angle, const Geom::Vec3f& Axis)
{ {
m_matrices[2] = glm::rotate(m_matrices[2], angle, glm::vec3(Axis[0],Axis[1],Axis[2])); glm::mat4 X = glm::rotate(m_matrices[2], angle, glm::vec3(Axis[0],Axis[1],Axis[2])) * m_matrices[2];
m_matrices[2] = X;
} }
void translate(const Geom::Vec3f& P) void translate(const Geom::Vec3f& P)
{ {
m_matrices[2] = glm::translate(m_matrices[2], glm::vec3(P[0],P[1],P[2])); glm::mat4 X = glm::translate(m_matrices[2], glm::vec3(P[0],P[1],P[2])) * m_matrices[2];
m_matrices[2] = X;
} }
void scale(const Geom::Vec3f& S) void scale(const Geom::Vec3f& S)
{ {
m_matrices[2] = glm::scale(m_matrices[2], glm::vec3(S[0],S[1],S[2])); glm::mat4 X = glm::scale(m_matrices[2], glm::vec3(S[0],S[1],S[2])) * m_matrices[2];
m_matrices[2] = X;
} }
void scale(float s) void scale(float s)
{ {
m_matrices[2] = glm::scale(m_matrices[2], glm::vec3(s,s,s)); glm::mat4 X = glm::scale(m_matrices[2], glm::vec3(s,s,s)) * m_matrices[2];
m_matrices[2] = X;
} }
void apply (const glm::mat4& m) void apply (const glm::mat4& m)
{ {
m_matrices[2] = m * m_matrices[2]; glm::mat4 X = m * m_matrices[2];
m_matrices[2] = X;
} }
}; };
......
...@@ -1123,7 +1123,7 @@ void GLSLShader::updateAllFromGLMatrices() ...@@ -1123,7 +1123,7 @@ void GLSLShader::updateAllFromGLMatrices()
model[i][j] = float(modelview[4*i+j]); model[i][j] = float(modelview[4*i+j]);
} }
} }
model *= currentTransfo(); model = currentTransfo() * model;
currentPMV() = proj * model; currentPMV() = proj * model;
currentNormalMatrix() = glm::gtx::inverse_transpose::inverseTranspose(model); currentNormalMatrix() = glm::gtx::inverse_transpose::inverseTranspose(model);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment