add very simple (rudimentary) time series graphing example

tweak camera near plane distance, less sensitive mouse wheel
This commit is contained in:
Erwin Coumans
2015-07-15 09:07:47 -07:00
parent 48f6484b3d
commit a6fa717dac
9 changed files with 1130 additions and 3 deletions

View File

@@ -34,6 +34,7 @@
#include "../SharedMemory/PhysicsServerExample.h"
#include "../SharedMemory/PhysicsClientExample.h"
#include "../Constraints/TestHingeTorque.h"
#include "../RenderingExamples/TimeSeriesExample.h"
#ifdef ENABLE_LUA
@@ -204,6 +205,7 @@ static ExampleEntry gDefaultExamples[]=
ExampleEntry(0,"Rendering"),
ExampleEntry(1,"Instanced Rendering", "Simple example of fast instanced rendering, only active when using OpenGL3+.",RenderInstancingCreateFunc),
ExampleEntry(1,"CoordinateSystemDemo","Show the axis and positive rotation direction around the axis.", CoordinateSystemCreateFunc),
ExampleEntry(1,"Time Series", "Render some value(s) in a 2D graph window, shifting to the left", TimeSeriesCreateFunc)
};

View File

@@ -24,6 +24,13 @@ struct GraphingTexture
m_imageData[x*4+y*4*m_width+3] = alpha;
}
void getPixel(int x, int y, unsigned char& red, unsigned char& green, unsigned char& blue, unsigned char& alpha)
{
red = m_imageData[x*4+y*4*m_width+0];
green = m_imageData[x*4+y*4*m_width+1];
blue = m_imageData[x*4+y*4*m_width+2];
alpha = m_imageData[x*4+y*4*m_width+3];
}
void uploadImageData();
int getTextureId()

View File

@@ -578,6 +578,14 @@ struct QuickCanvas : public Common2dCanvasInterface
btAssert(m_curNumGraphWindows==1);
m_gt[canvasId]->setPixel(x,y,red,green,blue,alpha);
}
virtual void getPixel(int canvasId, int x, int y, unsigned char& red, unsigned char& green,unsigned char& blue, unsigned char& alpha)
{
btAssert(canvasId==0);//hardcoded
btAssert(m_curNumGraphWindows==1);
m_gt[canvasId]->getPixel(x,y,red,green,blue,alpha);
}
virtual void refreshImageData(int canvasId)
{
m_gt[canvasId]->uploadImageData();