当前位置: 首页>>代码示例>>C++>>正文


C++ GLUI::add_translation方法代码示例

本文整理汇总了C++中GLUI::add_translation方法的典型用法代码示例。如果您正苦于以下问题:C++ GLUI::add_translation方法的具体用法?C++ GLUI::add_translation怎么用?C++ GLUI::add_translation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GLUI的用法示例。


在下文中一共展示了GLUI::add_translation方法的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);
}
开发者ID:bradens,项目名称:uvc,代码行数:45,代码来源:sea.cpp


注:本文中的GLUI::add_translation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。