fix canvas issues from previous commit
This commit is contained in:
@@ -142,7 +142,7 @@ void RaytracerPhysicsSetup::initPhysics()
|
|||||||
if (m_internalData->m_canvas)
|
if (m_internalData->m_canvas)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_internalData->m_canvasIndex = m_internalData->m_canvas->createCanvas("raytracer",m_internalData->m_width,m_internalData->m_height);
|
m_internalData->m_canvasIndex = m_internalData->m_canvas->createCanvas("raytracer",m_internalData->m_width,m_internalData->m_height, 15,55);
|
||||||
for (int i=0;i<m_internalData->m_width;i++)
|
for (int i=0;i<m_internalData->m_width;i++)
|
||||||
{
|
{
|
||||||
for (int j=0;j<m_internalData->m_height;j++)
|
for (int j=0;j<m_internalData->m_height;j++)
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ TimeSeriesCanvas::TimeSeriesCanvas(struct Common2dCanvasInterface* canvasInterfa
|
|||||||
|
|
||||||
if (canvasInterface)
|
if (canvasInterface)
|
||||||
{
|
{
|
||||||
m_internalData->m_canvasIndex = m_internalData->m_canvasInterface->createCanvas(windowTitle,m_internalData->m_width,m_internalData->m_height);
|
m_internalData->m_canvasIndex = m_internalData->m_canvasInterface->createCanvas(windowTitle,m_internalData->m_width,m_internalData->m_height,20,50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ struct TestCanvasInterface2 : public Common2dCanvasInterface
|
|||||||
|
|
||||||
virtual ~TestCanvasInterface2()
|
virtual ~TestCanvasInterface2()
|
||||||
{}
|
{}
|
||||||
virtual int createCanvas(const char* canvasName, int width, int height)
|
virtual int createCanvas(const char* canvasName, int width, int height,int posX,int posY)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,9 @@ struct MyMotorInfo2
|
|||||||
int m_qIndex;
|
int m_qIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int camVisualizerWidth = 320;//1024/3;
|
|
||||||
static int camVisualizerHeight = 240;//768/3;
|
static int camVisualizerWidth = 228;//1024/3;
|
||||||
|
static int camVisualizerHeight = 192;//768/3;
|
||||||
|
|
||||||
enum CustomCommands
|
enum CustomCommands
|
||||||
{
|
{
|
||||||
@@ -758,10 +759,10 @@ void PhysicsClientExample::initPhysics()
|
|||||||
m_canvas = m_guiHelper->get2dCanvasInterface();
|
m_canvas = m_guiHelper->get2dCanvasInterface();
|
||||||
if (m_canvas)
|
if (m_canvas)
|
||||||
{
|
{
|
||||||
|
m_canvasRGBIndex = m_canvas->createCanvas("Synthetic Camera RGB data",camVisualizerWidth, camVisualizerHeight, 8,55);
|
||||||
|
m_canvasDepthIndex = m_canvas->createCanvas("Synthetic Camera Depth data",camVisualizerWidth, camVisualizerHeight,8,75+camVisualizerHeight);
|
||||||
|
m_canvasSegMaskIndex = m_canvas->createCanvas("Synthetic Camera Segmentation Mask",camVisualizerWidth, camVisualizerHeight,8,95+camVisualizerHeight*2);
|
||||||
|
|
||||||
m_canvasRGBIndex = m_canvas->createCanvas("Synthetic Camera RGB data",camVisualizerWidth, camVisualizerHeight);
|
|
||||||
m_canvasDepthIndex = m_canvas->createCanvas("Synthetic Camera Depth data",camVisualizerWidth, camVisualizerHeight);
|
|
||||||
m_canvasSegMaskIndex = m_canvas->createCanvas("Synthetic Camera Segmentation Mask",camVisualizerWidth, camVisualizerHeight);
|
|
||||||
|
|
||||||
for (int i=0;i<camVisualizerWidth;i++)
|
for (int i=0;i<camVisualizerWidth;i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2138,7 +2138,7 @@ void PhysicsServerExample::updateGraphics()
|
|||||||
btScalar maxDepthValue = frustumZFar;
|
btScalar maxDepthValue = frustumZFar;
|
||||||
|
|
||||||
float depth = depthValue;
|
float depth = depthValue;
|
||||||
double linearDepth = 255.*(2.0 * frustumZNear) / (frustumZFar + frustumZNear - depth * (frustumZFar - frustumZNear));
|
btScalar linearDepth = 255.*(2.0 * frustumZNear) / (frustumZFar + frustumZNear - depth * (frustumZFar - frustumZNear));
|
||||||
btClamp(linearDepth, btScalar(0),btScalar(255));
|
btClamp(linearDepth, btScalar(0),btScalar(255));
|
||||||
rgb = linearDepth;
|
rgb = linearDepth;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user