Commit 6f6326c8 authored by Frédéric Larue's avatar Frédéric Larue

Display of SelectionManagerMeshVertices improved.

parent 31fe4d93
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
const char* SelectionManagerMeshVertices::s_DisplayShaderVSH = const char* SelectionManagerMeshVertices::s_DisplayShaderVSH =
"#version 330\n" "#version 330\n"
"uniform mat4 u_ModelViewMatrix;" "uniform mat4 u_CameraMatrix;"
"uniform mat4 u_ProjectionMatrix;"
"in vec3 vertexPosition;" "in vec3 vertexPosition;"
...@@ -17,7 +16,7 @@ const char* SelectionManagerMeshVertices::s_DisplayShaderVSH = ...@@ -17,7 +16,7 @@ const char* SelectionManagerMeshVertices::s_DisplayShaderVSH =
"void main()" "void main()"
"{" "{"
" idFloat = float( gl_VertexID );" " idFloat = float( gl_VertexID );"
" gl_Position = u_ProjectionMatrix * u_ModelViewMatrix * vec4(vertexPosition,1.0f);" " gl_Position = u_CameraMatrix * vec4(vertexPosition,1.0f);"
"}"; "}";
const char* SelectionManagerMeshVertices::s_DisplayShaderGSH = const char* SelectionManagerMeshVertices::s_DisplayShaderGSH =
...@@ -277,8 +276,8 @@ void SelectionManagerMeshVertices::onDisplay( GLViewer *viewer, const QMatrix4x4 ...@@ -277,8 +276,8 @@ void SelectionManagerMeshVertices::onDisplay( GLViewer *viewer, const QMatrix4x4
// Display selected vertices. // Display selected vertices.
m_DisplayShader.SetUniform( "u_ModelViewMatrix", (viewer->viewMatrix() * localTransfo).data() ); QMatrix4x4 cameraMatrix = viewer->projectionMatrix() * viewer->viewMatrix() * localTransfo;
m_DisplayShader.SetUniform( "u_ProjectionMatrix", viewer->projectionMatrix().data() ); m_DisplayShader.SetUniform( "u_CameraMatrix", cameraMatrix.data() );
GLfloat pointColor[4] = { 1.0f, 0.0f, 0.0f, 1.0f }; GLfloat pointColor[4] = { 1.0f, 0.0f, 0.0f, 1.0f };
m_DisplayShader.SetUniform( "u_Color", pointColor ); m_DisplayShader.SetUniform( "u_Color", pointColor );
......
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