示例#1
0
static void key(unsigned char key, int x, int y)
{
    referenceUnusedParameter(x);
    referenceUnusedParameter(y);
    switch(key)
    {
    case 27:
        glutLeaveMainLoop();
        break;
    case 'f':
        autoColor();
        break;
    case 'q':
        er += 0.01;
        break;
    case 'a':
        er -= 0.01;
        break;
    case 'w':
        eg += 0.01;
        break;
    case 's':
        eg -= 0.01;
        break;
    case 'e':
        eb += 0.01;
        break;
    case 'd':
        eb -= 0.01;
        break;
    case 't':
        startiter += 1;
        break;
    case 'g':
        startiter -= 1;
        break;
    case 'T':
        startiter += 10;
        break;
    case 'G':
        startiter -= 10;
        break;
    case 'z':
        enditer += 1;
        break;
    case 'h':
        enditer -= 1;
        break;
    case 'Z':
        enditer += 10;
        break;
    case 'H':
        enditer -= 10;
        break;
    case 'v':
    {   double tmp = enditer;
        enditer = startiter;
        startiter = tmp;
    }
    break;
    case 'u':
        maxiter = maxiter * 20 / 19;
        return;
    case 'j':
        maxiter = maxiter * 19 / 20;
        return;
    case 'U':
        maxiter = maxiter * 5 / 4;
        return;
    case 'J':
        maxiter = maxiter * 4 / 5;
        return;
    case 'r':
        render();
        return;
    case '0':
        center.r = 0;
        center.i = 0;
        scale = 4.0;
        er = 3.0;
        eg = 0.75;
        eb = 0.5;
        startiter = -4;
        enditer = 77;
        maxiter = 8192;
        clear();
        return;
    }
    lastchange = glutGet(GLUT_ELAPSED_TIME);
    redrawflag = 1;
}
示例#2
0
void
Controller::drawGraph()
{
	float sx = 0.03f;
	float sy = 0.45f;

	float xOffset = 0.0f;

	glDisable(GL_LIGHTING);
	
	float unit = 2.0f, temp;
	char title[256];

	for(int i=0;i<1;i++)
	{
		float frame;

		frame = realWingbeat.prevFrame + realWingbeat.frame;
		
		drawEachAxis(xOffset, unit*6.0f, frame);
		drawEachGraph( CaptureMotion::d_lshoulder1, unit*6.0f, autoColor(0));
		//drawEachGraph( CaptureMotion::d_rshoulder1, unit*6.0f, autoColor(1));

		/*drawEachAxis(xOffset, unit*5.0f, frame);
		drawEachGraph( CaptureMotion::d_lshoulder2, unit*5.0f, autoColor(0));
		drawEachGraph( CaptureMotion::d_rshoulder2, unit*5.0f, autoColor(1));

		drawEachAxis(xOffset, unit*4.0f, frame);
		drawEachGraph( CaptureMotion::d_lshoulder3, unit*4.0f, autoColor(0));
		drawEachGraph( CaptureMotion::d_rshoulder3, unit*4.0f, autoColor(1));*/

		/*extractEachGraph( CaptureMotion::d_lshoulder1, unit*6.0f, autoColor(0));
		extractEachGraph( CaptureMotion::d_lshoulder2, unit*5.0f, autoColor(0));
		extractEachGraph( CaptureMotion::d_lshoulder3, unit*4.0f, autoColor(0));

		extractEachGraph( CaptureMotion::d_lelbow_bend, unit*5.0f, autoColor(0));
		extractEachGraph( CaptureMotion::d_lelbow_twist, unit*4.0f, autoColor(0));

		extractEachGraph( CaptureMotion::d_lwrist_bend, unit*5.0f, autoColor(0));
		
		extractEachGraph( CaptureMotion::d_tail_bend, unit*5.0f, autoColor(0));
		extractEachGraph( CaptureMotion::d_tail_spread, unit*4.0f, autoColor(0));

		cin.get();
		cin.get();*/

		/*drawEachAxis(xOffset, unit*3.0f, frame);
		drawEachGraph( CaptureMotion::d_lelbow_bend, unit*3.0f, autoColor(0));
		drawEachGraph( CaptureMotion::d_relbow_bend, unit*3.0f, autoColor(1));

		drawEachAxis(xOffset, unit*2.0f, frame);
		drawEachGraph( CaptureMotion::d_lelbow_twist, unit*2.0f, autoColor(0));
		drawEachGraph( CaptureMotion::d_relbow_twist, unit*2.0f, autoColor(1));

		drawEachAxis(xOffset, unit*1.0f, frame);
		drawEachGraph( CaptureMotion::d_lwrist_bend, unit*1.0f, autoColor(0));
		drawEachGraph( CaptureMotion::d_rwrist_bend, unit*1.0f, autoColor(1));

		drawEachAxis(xOffset, unit*0.0f, frame);
		drawEachGraph( CaptureMotion::d_tail_bend, unit*0.0f, autoColor(2));
		drawEachGraph( CaptureMotion::d_tail_spread, unit*0.0f, autoColor(3));	*/
	}

	glEnable(GL_LIGHTING);
}