Commit e1d0f43b authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

minor changes

parent 262c5ad4
...@@ -19,9 +19,11 @@ void main(void) ...@@ -19,9 +19,11 @@ void main(void)
vec4 newPos = ModelViewMatrix * vec4(center,0.0); vec4 newPos = ModelViewMatrix * vec4(center,0.0);
vec3 L = normalize (lightPosition - newPos.xyz); vec3 L = normalize (lightPosition - newPos.xyz);
float lambertTerm = dot(N,L); float lambertTerm = dot(N,L);
ColorFS = ambient; ColorFS = ambient;
if(lambertTerm > 0.0)
ColorFS += diffuse * lambertTerm; if(lambertTerm > 0.0)
ColorFS += diffuse * lambertTerm;
int i; int i;
for(i=0; i< NBVERTS_IN; i++) for(i=0; i< NBVERTS_IN; i++)
{ {
......
...@@ -1036,7 +1036,7 @@ void GLSLShader::setCurrentOGLVersion(unsigned int version) ...@@ -1036,7 +1036,7 @@ void GLSLShader::setCurrentOGLVersion(unsigned int version)
*/ */
void GLSLShader::updateMatrices(const glm::mat4& projection, const glm::mat4& modelview) void GLSLShader::updateMatrices(const glm::mat4& projection, const glm::mat4& modelview)
{ {
this->bind(); this->bind();
if (*m_uniMat_Proj >= 0) if (*m_uniMat_Proj >= 0)
glUniformMatrix4fv(*m_uniMat_Proj, 1, false, &projection[0][0]); glUniformMatrix4fv(*m_uniMat_Proj, 1, false, &projection[0][0]);
......
...@@ -459,7 +459,7 @@ void SimpleQT::updateGL() ...@@ -459,7 +459,7 @@ void SimpleQT::updateGL()
void SimpleQT::updateGLMatrices() void SimpleQT::updateGLMatrices()
{ {
m_glWidget->modelModified(); m_glWidget->modelModified();
// m_glWidget->updateGL(); updateGL();
} }
void SimpleQT::transfoRotate(float angle, float x, float y, float z) void SimpleQT::transfoRotate(float angle, float x, float y, float z)
......
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