Improved simple TimeSeriesCanvas

Fixes in RobotControlExample
Disable gravity by default in PhysicsServer
This commit is contained in:
erwincoumans
2015-08-07 13:17:33 -07:00
parent 03d991c92b
commit 89c2a729ce
10 changed files with 1201 additions and 1103 deletions

View File

@@ -74,116 +74,4 @@ void GraphingTexture::uploadImageData()
}
#if 0
//shift the image one pixel
for(int y=0;y<texHeight;++y)
{
// const int t=y>>5;
for(int x=1;x<texWidth;++x)
{
GLubyte* org=image+(x+y*texWidth)*4;
GLubyte* dst=image+(x-1+y*texWidth)*4;
dst[0] = org[0];
dst[1] = org[1];
dst[2] = org[2];
dst[3] = org[3];
}
}
//render a new row at the right
for(int y=0;y<texHeight;++y)
{
GLubyte* pi=image+(texWidth-1+y*texWidth)*4;
pi[0]=255;
pi[1]=255;
pi[2]=255;
pi[3]=255;
if (y==texHeight*0.5)
{
pi[0]=200;
pi[1]=200;
pi[2]=200;
pi[3]=255;
}
}
{
static float timer = 0.f;
static int prevValue=0;
timer+= 0.01;
float value = 128+100*sinf(timer);
MyClamp(value,0.f,float(texHeight-1));
GLubyte* org=image+(texWidth-1+(int)value*texWidth)*4;
org[0] = 0;
org[1] = 0;
org[2] = 0;
org[3] = 255;
if (prevValue<value)
{
} else
{
}
}
{
static float timer = 1.4f;
timer+= 0.04;
float value = 128+150*sinf(timer);
MyClamp(value,0.f,float(texHeight-1));
GLubyte* org=image+(texWidth-1+(int)value*texWidth)*4;
org[0] = 0;
org[1] = 255;
org[2] = 0;
org[3] = 255;
}
{
static float timer = 1.4f;
timer+= 0.02;
float value =256+400*sinf(timer);
MyClamp(value,0.f,float(texHeight-1));
static int prevValue = 0;
GLubyte* org=image+(texWidth-1+(int)value*texWidth)*4;
org[0] = 0;
org[1] = 0;
org[2] = 255;
org[3] = 255;
if (prevValue<value)
{
for (int i=prevValue;i<value;i++)
{
GLubyte* org=image+(texHeight-1+(int)i*texWidth)*4;
org[0] = 0;
org[1] = 0;
org[2] = 255;
org[3] = 255;
}
} else
{
for (int i=value;i<prevValue;i++)
{
GLubyte* org=image+(texHeight-1+(int)i*texWidth)*4;
org[0] = 0;
org[1] = 0;
org[2] = 255;
org[3] = 255;
}
}
prevValue = value;
}
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texWidth,texHeight,0,GL_RGBA,GL_UNSIGNED_BYTE,image);
glGenerateMipmap(GL_TEXTURE_2D);
#endif