本文整理汇总了C++中GLUI::add_rotation方法的典型用法代码示例。如果您正苦于以下问题:C++ GLUI::add_rotation方法的具体用法?C++ GLUI::add_rotation怎么用?C++ GLUI::add_rotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLUI
的用法示例。
在下文中一共展示了GLUI::add_rotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(500,500);
glutInitWindowPosition(100,100);
win = glutCreateWindow(argv[0]);
/* initialize background, objects, camera, etc. */
init();
/* callback functions */
GLUI_Master.set_glutDisplayFunc(display);
GLUI_Master.set_glutReshapeFunc(reshape);
GLUI_Master.set_glutKeyboardFunc(keyboard);
/* GLUI Code */
//Subwindow doesn't seem to work with mac.. refresh is not correct
// GLUI *glui = GLUI_Master.create_glui_subwindow(win, GLUI_SUBWINDOW_RIGHT);
GLUI *glui = GLUI_Master.create_glui("Controls"/*name*/,0/*flags*/,100+500,100 /*x y*/);
glui->set_main_gfx_window(win);
GLUI_Rotation *view_rot = glui->add_rotation("Camera", curview);
view_rot->set_spin(1.0);
GLUI_Translation *trans_xy = glui->add_translation("XY", GLUI_TRANSLATION_XY, cameraPosition);
trans_xy->set_speed(0.005);
GLUI_Translation *trans_x =
glui->add_translation( "Objects X", GLUI_TRANSLATION_X, cameraPosition );
trans_x->set_speed( .005 );
GLUI_Translation *trans_y =
glui->add_translation( "Objects Y", GLUI_TRANSLATION_Y, &cameraPosition[1] );
trans_y->set_speed( .005 );
GLUI_Translation *trans_z =
glui->add_translation( "Objects Z", GLUI_TRANSLATION_Z, &cameraPosition[2] );
trans_z->set_speed( .005 );
glui->add_button("Reset View", RESET_VIEW, placeCamera);
GLUI_Master.set_glutIdleFunc(myGlutIdle);
glutMainLoop();
return(0);
}