samples/frustum.c
/* Called by GLFW whenever a key is pressed. */
Called by GLFW whenever a key is pressed.
Called by GLFW whenever a key is pressed .
void keyboard(GLFWwindow* window, int key, int scancode, int action, int mods)
{
	if (kuhl_keyboard_handler(window, key, scancode, action, mods))
		return;
	if(action != GLFW_PRESS)
		return;
	switch(key)
	{
		case GLFW_KEY_A: 
			camPos[0] -= .2;
			break;
		case GLFW_KEY_D: 
			camPos[0] += .2;
			break;
		case GLFW_KEY_W: 
			camPos[1] += .2;
			break;
		case GLFW_KEY_S: 
			camPos[1] -= .2;
			break;
		case GLFW_KEY_Z: 
			camPos[2] -= .2;
			if(screen[4]-camPos[2] > -.2)
				camPos[2] = .2+screen[4];
			break;
		case GLFW_KEY_X: 
			camPos[2] += .2;
			break;
	}
	printf("camera position: ");
	vec3f_print(camPos);
}
void keyboard ( GLFWwindow * window , int key , int scancode , int action , int mods ) { if ( kuhl_keyboard_handler ( window , key , scancode , action , mods ) ) return ; if ( action != GLFW_PRESS ) return ; switch ( key ) { case GLFW_KEY_A : camPos [ 0 ] -= .2 ; break ; case GLFW_KEY_D : camPos [ 0 ] += .2 ; break ; case GLFW_KEY_W : camPos [ 1 ] += .2 ; break ; case GLFW_KEY_S : camPos [ 1 ] -= .2 ; break ; case GLFW_KEY_Z : camPos [ 2 ] -= .2 ; if ( screen [ 4 ] - camPos [ 2 ] > -.2 ) camPos [ 2 ] = .2 + screen [ 4 ] ; break ; case GLFW_KEY_X : camPos [ 2 ] += .2 ; break ; } printf ( " " ) ; vec3f_print ( camPos ) ; }
Called by GLFW whenever a key is pressed.
Called by GLFW whenever a key is pressed .
/* If the library handles this keypress, return */ // left // right // up // down // toward screen // away from screen