diff --git a/examples/SharedMemory/PhysicsClientExample.cpp b/examples/SharedMemory/PhysicsClientExample.cpp index e7e02ba51..e7d797fa6 100644 --- a/examples/SharedMemory/PhysicsClientExample.cpp +++ b/examples/SharedMemory/PhysicsClientExample.cpp @@ -631,7 +631,7 @@ void PhysicsClientExample::stepSimulation(float deltaTime) int bytesPerPixel = 4; int pixelIndex = (xIndex+yIndex*imageData.m_pixelWidth)*bytesPerPixel; - m_canvas->setPixel(m_canvasIndex,i,camVisualizerHeight-1-j, + m_canvas->setPixel(m_canvasIndex,i,j, imageData.m_rgbColorData[pixelIndex], imageData.m_rgbColorData[pixelIndex+1], diff --git a/examples/SharedMemory/TinyRendererVisualShapeConverter.cpp b/examples/SharedMemory/TinyRendererVisualShapeConverter.cpp index 3bb5e893e..ebe11877a 100644 --- a/examples/SharedMemory/TinyRendererVisualShapeConverter.cpp +++ b/examples/SharedMemory/TinyRendererVisualShapeConverter.cpp @@ -580,7 +580,9 @@ void TinyRendererVisualShapeConverter::render(const float viewMat[16], const flo } } //printf("write tga \n"); - m_data->m_rgbColorBuffer.write_tga_file("camera.tga"); + //m_data->m_rgbColorBuffer.write_tga_file("camera.tga"); +// printf("flipped!\n"); + m_data->m_rgbColorBuffer.flip_vertically(); } diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 0bac58313..41625b8cf 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -459,15 +459,16 @@ static PyObject* pybullet_renderImage(PyObject* self, PyObject* args) } Py_DECREF(seq); - if (valid) { b3SharedMemoryCommandHandle command; command = b3InitRequestCameraImage(sm); - + if (valid) + { //printf("set b3RequestCameraImageSetCameraMatrices\n"); b3RequestCameraImageSetCameraMatrices(command, viewMatrix, projectionMatrix); - + } + b3RequestCameraImageSetPixelResolution(command,width,height); if (b3CanSubmitCommand(sm)) @@ -489,24 +490,25 @@ static PyObject* pybullet_renderImage(PyObject* self, PyObject* args) PyObject *pylistPos; PyObject* pylistDep; + int i,j,p; //printf("image width = %d, height = %d\n", imageData.m_pixelWidth, imageData.m_pixelHeight); { PyObject *item; - int bytesPerPixel = 3;//Red, Green, Blue, each 8 bit values + int bytesPerPixel = 4;//Red, Green, Blue, each 8 bit values int num=bytesPerPixel*imageData.m_pixelWidth*imageData.m_pixelHeight; pylistPos = PyTuple_New(num); pylistDep = PyTuple_New(imageData.m_pixelWidth*imageData.m_pixelHeight); - for (int i=0;i