本文整理汇总了C++中camera::set_look_right方法的典型用法代码示例。如果您正苦于以下问题:C++ camera::set_look_right方法的具体用法?C++ camera::set_look_right怎么用?C++ camera::set_look_right使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类camera
的用法示例。
在下文中一共展示了camera::set_look_right方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gluNewQuadric
int
main( int argc, char *argv[ ] )
{
cmd_args args;
if( !args.parse( argc, (const char**)argv ) ) {
return 1;
}
//setup glut
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA );
glutInitWindowSize( 640, 480 );
glutCreateWindow( "Flock of Birds Demo" );
//setup gl
init_gl( );
//set callbacks
glutKeyboardFunc( handle_keyboard );
glutReshapeFunc( handle_resize );
glutDisplayFunc( render );
glutIdleFunc( render );
#if ENABLE_FBB
fob::hemisphere hemisphere = fob::DOWN;
fob::port_speed speed = args.speed;
//talk to flock
flock.open( args.serial, hemisphere, speed, args.sleep_ms );
if( !flock ) {
std::cerr << "fatal: " << flock.get_error( ) << std::endl;
return 1;
}
//get a list of birds connected to the machine
fob::bird_list& birds = flock.get_birds( );
p_birds = &flock.get_birds( );
num_birds = birds.size( );
if( num_birds > MAX_ENTS ) num_birds = MAX_ENTS;
#else
unsigned int num_birds = 1;
#endif
#if ENABLE_FBB
//for each bird, set that we want position and orientation
for( unsigned int i = 0; i < birds.size( ); ++i ) {
if( !birds[ i ]->set_mode( fob::POSITION | fob::ORIENTATION | fob::BUTTONS ) ) {
std::cerr << "fatal: " << flock.get_error( ) << std::endl;
return 1;
}
}
#endif
//setup the camera
cam.set_position( 0.0, 100.0, 0.0 );
cam.set_look_right( math::vector3( 0.0, 0.0, 0.0 ), math::vector3::X_AXIS );
#if ENABLE_FBB
//set the flock flying
flock.fly( );
atexit( handle_exit );
//let the bird start up . . .
sleep( 1 );
#endif
//create the button sphere
sphere = gluNewQuadric( );
//start glut
glutMainLoop( );
//no errors
return 0;
}