camera y position control by arrows UP/DOWN
This commit is contained in:
		
							parent
							
								
									1197e69fa4
								
							
						
					
					
						commit
						549d59e873
					
				
							
								
								
									
										4
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								window.c
									
									
									
									
									
								
							@ -46,7 +46,7 @@ struct cam_t {
 | 
			
		||||
	float theta;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static cam_t _cam = {0, 1.0f, 50, 0};
 | 
			
		||||
static cam_t _cam = {0, 1.0f, 10, 0};
 | 
			
		||||
 | 
			
		||||
static float _v = 0.1f;
 | 
			
		||||
 | 
			
		||||
@ -251,8 +251,10 @@ void key(int keycode) {
 | 
			
		||||
	double dtheta = M_PI, step = 5.0;
 | 
			
		||||
	switch(keycode) {
 | 
			
		||||
		case GL4DK_UP:
 | 
			
		||||
			_cam.y += 5 * dtheta;
 | 
			
		||||
			break;
 | 
			
		||||
		case GL4DK_DOWN:
 | 
			
		||||
			_cam.y -= 5 * dtheta;
 | 
			
		||||
			break;
 | 
			
		||||
		case GL4DK_RIGHT:
 | 
			
		||||
			_s += 30.0f;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user