From 21462d1c02181034c63c2a2ce5b144117b36c0c0 Mon Sep 17 00:00:00 2001 From: Max Argus Date: Thu, 12 Jul 2018 19:34:08 +0200 Subject: [PATCH] update GLIR camera --- examples/SharedMemory/plugins/eglPlugin/bullet.py | 4 ++-- .../plugins/eglPlugin/eglRendererVisualShapeConverter.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/SharedMemory/plugins/eglPlugin/bullet.py b/examples/SharedMemory/plugins/eglPlugin/bullet.py index d20809894..73060b7d2 100644 --- a/examples/SharedMemory/plugins/eglPlugin/bullet.py +++ b/examples/SharedMemory/plugins/eglPlugin/bullet.py @@ -25,10 +25,10 @@ p.loadSDF(path) start = time.time() -plot = False +plot = True try: for i in range(10): - hight, width, img_arr, deept_arr, obj_arr = p.getCameraImage(80,80) + hight, width, img_arr, deept_arr, obj_arr = p.getCameraImage(128,128) if plot: plt.imshow(img_arr[:,:,:3]) plt.show() diff --git a/examples/SharedMemory/plugins/eglPlugin/eglRendererVisualShapeConverter.cpp b/examples/SharedMemory/plugins/eglPlugin/eglRendererVisualShapeConverter.cpp index 70ad1dd51..58f721f66 100644 --- a/examples/SharedMemory/plugins/eglPlugin/eglRendererVisualShapeConverter.cpp +++ b/examples/SharedMemory/plugins/eglPlugin/eglRendererVisualShapeConverter.cpp @@ -166,6 +166,7 @@ struct TinyRendererVisualShapeConverterInternalData m_instancingRenderer->resize(m_swWidth,m_swHeight); m_instancingRenderer->InitShaders(); m_instancingRenderer->setActiveCamera(&m_camera); + m_instancingRenderer->updateCamera(); m_instancingRenderer->setLightPosition(m_lightDirection); } @@ -875,6 +876,8 @@ void TinyRendererVisualShapeConverter::setUpAxis(int axis) m_data->m_upAxis = axis; m_data->m_camera.setCameraUpAxis(axis); m_data->m_camera.update(); + m_data->m_instancingRenderer->updateCamera(); + } void TinyRendererVisualShapeConverter::resetCamera(float camDist, float yaw, float pitch, float camPosX,float camPosY, float camPosZ) { @@ -884,7 +887,7 @@ void TinyRendererVisualShapeConverter::resetCamera(float camDist, float yaw, flo m_data->m_camera.setCameraTargetPosition(camPosX,camPosY,camPosZ); m_data->m_camera.setAspectRatio((float)m_data->m_swWidth/(float)m_data->m_swHeight); m_data->m_camera.update(); - + m_data->m_instancingRenderer->updateCamera(); } void TinyRendererVisualShapeConverter::clearBuffers(TGAColor& clearColor)