Пример #1
0
void SpinningCube::Draw() {
	//glMatrixMode(GL_MODELVIEW);
	//glLoadMatrixf(WorldMtx);
	//glutWireCube(Size);
	/*
	Joint test = Joint("Test");
	test.setPose(Vector3(45, 45, 0));
	test.setTranslation(Vector3(0, 0, 0));
	test.setScale(Vector3(1, 1, 1), Vector3(0, 0, 0));
	test.calculate();
	Joint test1 = Joint("Test2");
	test1.setDOFX(0);
	test1.setDOFY(0);
	test1.setDOFZ(0);
	test1.setTranslation(Vector3(0, 1.5, 0));
	test1.setScale(Vector3(1, 1, 1), Vector3(0, 0, 0));
	test1.calculate();
	test.addChild(test1);
	Joint *test2 = test1.getParent();
	test.draw(WorldMtx.IDENTITY);*/

	Skeleton test = Skeleton();
	test.Load("test.skel");
	test.calculate(WorldMtx.IDENTITY);
	test.draw();
}
Пример #2
0
void MyWindow::draw()
{
    Skeleton* model = mMainMotion.getSkel();

    // validate the frame index
    int nFrames = mMainMotion.getNumFrames();
    int fr = mFrame;
    if (fr >= nFrames) fr = nFrames-1;
    
    // update and draw the motion
    model->setPose(mMainMotion.getPoseAtFrame(fr));
    model->draw(mRI);
    
    Skeleton* model2 = mCompareMotion.getSkel();
    if (fr >= mCompareMotion.getNumFrames()) 
        fr = mCompareMotion.getNumFrames() - 1;
    model2->setPose(mCompareMotion.getPoseAtFrame(fr));
    model2->draw(mRI);       

    if(mShowMarker) model->drawMarkers(mRI);
    if(mShowProgress) yui::drawProgressBar(fr,mMaxFrame);

    // display the frame count in 2D text
    char buff[64];
    sprintf(buff,"%d/%d",mFrame,mMaxFrame);
    string frame(buff);
    glDisable(GL_LIGHTING);
    glColor3f(0.0,0.0,0.0);
    yui::drawStringOnScreen(0.02f,0.02f,frame);
    glEnable(GL_LIGHTING);
}