From ecc192df94933e6aac2c3dc9f8998973b855b47c Mon Sep 17 00:00:00 2001 From: Jasmine Hsu Date: Fri, 10 Jun 2016 15:07:52 -0700 Subject: [PATCH] render image with ability to set pixel resolution and initial camera position --- examples/SharedMemory/PhysicsClientExample.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/SharedMemory/PhysicsClientExample.cpp b/examples/SharedMemory/PhysicsClientExample.cpp index e7d797fa6..bcd84d321 100644 --- a/examples/SharedMemory/PhysicsClientExample.cpp +++ b/examples/SharedMemory/PhysicsClientExample.cpp @@ -628,7 +628,7 @@ void PhysicsClientExample::stepSimulation(float deltaTime) int yIndex = int(float(j)*(float(imageData.m_pixelHeight)/float(camVisualizerHeight))); btClamp(yIndex,0,imageData.m_pixelHeight); btClamp(xIndex,0,imageData.m_pixelWidth); - int bytesPerPixel = 4; + int bytesPerPixel = 4; //RGBA int pixelIndex = (xIndex+yIndex*imageData.m_pixelWidth)*bytesPerPixel; m_canvas->setPixel(m_canvasIndex,i,j, @@ -636,8 +636,7 @@ void PhysicsClientExample::stepSimulation(float deltaTime) imageData.m_rgbColorData[pixelIndex], imageData.m_rgbColorData[pixelIndex+1], imageData.m_rgbColorData[pixelIndex+2], - 255); -// imageData.m_rgbColorData[pixelIndex+3]); + 255); //alpha set to 255 } } m_canvas->refreshImageData(m_canvasIndex);