diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-05-16 09:31:38 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-05-16 12:42:44 +0200 |
commit | 2c7a4e8aff00f88dcc333f607a1c4334b197a4a1 (patch) | |
tree | b41ac90818b0b6d6f0328695d5e82d9d55df6375 /chart2/source | |
parent | 6709d982a5558cab4d0b7e13d5c72a3b074704d6 (diff) |
set the MVP matrix in picking mode
Change-Id: I11d4838a320ada1d454870436e540b2c56fa18fd
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/view/main/GL3DRenderer.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index c661e33b8029..bcb87b28649a 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -782,7 +782,8 @@ void OpenGL3DRenderer::RenderPolygon3D(Polygon3DInfo &polygon) } else { - // TODO: moggi: model matrix + glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; + glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); } GLint maVertexID = mbPickingMode ? maPickingResources.m_2DVertexID : maResources.m_3DVertexID; @@ -1085,7 +1086,8 @@ void OpenGL3DRenderer::RenderExtrudeFlatSurface(const Extrude3DInfo& extrude3D, } else { - // TODO: moggi: model matrix + glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; + glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); } glDrawElements(GL_TRIANGLES, extrude3D.size[surIndex], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[surIndex])); @@ -1127,7 +1129,8 @@ void OpenGL3DRenderer::RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D } else { - // TODO: moggi: model matrix + glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; + glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); } glDrawElements(GL_TRIANGLES, extrude3D.size[BOTTOM_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[BOTTOM_SURFACE])); } @@ -1170,7 +1173,8 @@ void OpenGL3DRenderer::RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D } else { - // TODO: moggi: model matrix + glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; + glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); } glDrawElements(GL_TRIANGLES, extrude3D.size[MIDDLE_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[MIDDLE_SURFACE])); } @@ -1214,7 +1218,8 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D) } else { - // TODO: moggi: model matrix + glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; + glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); } glDrawElements(GL_TRIANGLES, extrude3D.size[TOP_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[TOP_SURFACE])); RenderExtrudeFlatSurface(extrude3D, FLAT_BOTTOM_SURFACE); @@ -1243,7 +1248,8 @@ void OpenGL3DRenderer::RenderNonRoundedBar(const Extrude3DInfo& extrude3D) } else { - // TODO: moggi: model matrix + glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model; + glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]); } glDrawArrays(GL_TRIANGLES, 0, 36); } |