示例#1
0
void testApp::keyPressed(int key){
	if(key==OF_KEY_LEFT) { 
		prevScene(); 
	} else if(key==OF_KEY_RIGHT) { 
		nextScene(); 
	} else if(key=='c') { 
		cameraManager.next(); 
	} else if(key=='w') { 
		cameraManager.toggleWarperGui(); 
	}

}
//--------------------------------------------------------------
void ofApp::keyPressed(int key){
	switch (key) {
	case 'f':
		ofToggleFullscreen();
		break;
	case 'c':
		doDrawSmallColour = !doDrawSmallColour;
		break;
	case OF_KEY_LEFT:
		if (mode == MULTIPLE_SCENES) prevScene();
		break;
	case OF_KEY_RIGHT:
		if (mode == MULTIPLE_SCENES) nextScene();
		break;
	default:
		break;
	}
}
示例#3
0
//-------------------- protected methods -----------------------------
void ControlPanel::controlChanged( int control_enum_value ){
    switch ( control_enum_value ){
        case LIGHTING_CHECKBOX:
            if( !lighting )
                glDisable( GL_LIGHT0 );
            else
                glEnable( GL_LIGHT0 );
            break;
        case DRAWAXES_CHECKBOX:
            curScene->setDrawAxes( drawAxes );
            break;
        case PREVSCENE_BUTTON:
            prevScene();
            break;
        case NEXTSCENE_BUTTON:
            nextScene();
            break;
        case QUIT_BUTTON:
            exit( 0 );
            break;
        case SET_PROJECTION:
            if( which_projection == 0 )
                world->at( curSceneIndex )->setParallelStatus( true );
            else
                world->at( curSceneIndex )->setParallelStatus( false );
        case LOOKAT:
            updateWorldWithSlider();
            break;
        case PERSPECTIVE:
            world->at( curSceneIndex )->setPerspective( viewAngle,
                                                        aspectRatio,
                                                        near, far );
            break;
        case SET_LOOKAT:
            setLookAtSliders(  );
            break;
        case SET_ADVANCED:
            setAdvancedSliders(  );
            break;
        case ADVANCED:
            updateAdvanced(  );
            break;
        case BOX_BUTTON:
            world->at( curSceneIndex )->addObject( new Box() );
            world->at( curSceneIndex )->redraw();
            break;
        case CLOWN_BUTTON:
            world->at( curSceneIndex )->addObject( new Clown() );
            world->at( curSceneIndex )->redraw();
            break;
        case DONUT_BUTTON:
            world->at( curSceneIndex )->addObject( new Donut() );
            world->at( curSceneIndex )->redraw();
            break;
        case EYE_BUTTON:
            world->at( curSceneIndex )->addObject( new Eye() );
            world->at( curSceneIndex )->redraw();
            break;
        case HAT_BUTTON:
            world->at( curSceneIndex )->addObject( new Hat() );
            world->at( curSceneIndex )->redraw();
            break;
        case HEAD_BUTTON:
            world->at( curSceneIndex )->addObject( new Head() );
            world->at( curSceneIndex )->redraw();
            break;
        case SNOWMAN_BUTTON:
            world->at( curSceneIndex )->addObject( new Snowman() );
            world->at( curSceneIndex )->redraw();
            break;
        case SPHERE_BUTTON:
            world->at( curSceneIndex )->addObject( new Sphere() );
            world->at( curSceneIndex )->redraw();
            break;
    }
}