void display(void) { Matrix m1, m2, m3; Quaternion q1; tball.getRotation().getValue(m3); q1.setValue(m3); m1.setRotate(q1); // std::cout << "TBROT" << std::endl << tball.getRotation() << std::endl; // std::cout << "M3" << std::endl << m3 << std::endl; // std::cout << "Q1" << std::endl << q1 << std::endl; // std::cout << "M1" << std::endl << m1 << std::endl; // m1.setRotate( tball.getRotation() ); m2.setTranslate( tball.getPosition() ); //std::cout << "Pos: " << tball.getPosition() << ", Rot: " << tball.getRotation() << std::endl; // std::cout << tball.getRotation() << std::endl; m1.mult( m2 ); cam_trans->editSFMatrix()->setValue( m1 ); win->draw( ract ); }
void display(void) { Matrix m1, m2; m1.setRotate( tball.getRotation() ); m2.setTranslate( tball.getPosition() ); m1.mult( m2 ); cam_trans->editSFMatrix()->setValue( m1 ); // move the object float t = glutGet(GLUT_ELAPSED_TIME); Quaternion q; q.setValueAsAxisDeg(0, 1, 0, t / 5000); m1.setTransform(Vec3f(osgsin(t / 500.), 0, osgcos(t / 500)), q); tr->setMatrix(m1); if ( doRender ) win->render( ract ); else win->draw( dact ); }
void display(void) { Matrix m1, m2, m3; Quaternion q1; #ifdef PAR_SCHEDULER if(pVSCThread == NULL) { pVSCThread = ExternalThread::find("VSCScheduler"); } VSC::VSCScheduler::the()->enterSyncBarrier(2); pVSCThread->getChangeList()->applyToCurrent(); pVSCThread->getChangeList()->clearAll(); // VSC::vsc_sleep(100); VSC::VSCScheduler::the()->enterSyncBarrier(2); #endif // tball.getRotation().getValue(m3); // q1.setValue(m3); // m1.setRotate(q1); // cout << "TBROT" << endl << tball.getRotation() << endl; // cout << "M3" << endl << m3 << endl; // cout << "Q1" << endl << q1 << endl; // cout << "M1" << endl << m1 << endl; // m1.setRotate( tball.getRotation() ); // m2.setTranslate( tball.getPosition() ); //cout << "Pos: " << tball.getPosition() << ", Rot: " << tball.getRotation() << endl; // cout << tball.getRotation() << endl; // m1.mult( m2 ); cam_trans->getSFMatrix()->setValue(tball.getFullTrackballMatrix()); /* fprintf(stderr, "%d %d %d %d | %d | %d\r", glutGet(GLUT_WINDOW_RED_SIZE), glutGet(GLUT_WINDOW_GREEN_SIZE), glutGet(GLUT_WINDOW_BLUE_SIZE), glutGet(GLUT_WINDOW_ALPHA_SIZE), glutGet(GLUT_WINDOW_DEPTH_SIZE), glutGet(GLUT_WINDOW_STENCIL_SIZE)); */ win->draw( ract ); }
void display(void) { Matrix m1, m2, m3; Quaternion q1; tball.getRotation().getValue(m3); q1.setValue(m3); m1.setRotate(q1); m2.setTranslate( tball.getPosition() ); m1.mult( m2 ); cam_trans->editSFMatrix()->setValue( m1 ); window->draw( drAct ); }
void display(void) { Matrix m1, m2, m3; m1=trackball.getMatrix(); // m1.transpose(); // m2.setTranslate(0,0,8); // m1.mult(m2); cam_trans->editSFMatrix()->setValue( m1 ); win->draw( ract ); }
void display(void) { Matrix m1, m2; m1.setRotate(tball.getRotation()); m2.setTranslate(tball.getPosition()); m1.mult(m2); cam_trans->editSFMatrix()->setValue(m1); if(doRender) win->render(ract); else win->draw(dact); }