scenes/inf585/project/src/main.cpp
// Function called every time the screen is resized
Function called every time the screen is resized
Function called every time the screen is resized
void window_size_callback(GLFWwindow* , int width, int height)
{	
	glViewport(0, 0, width, height); 
	float const aspect = width / static_cast<float>(height); 
	float const field_of_view = 50.0f*pi/180.0f; 
	float const z_near = 0.1f;  
	float const z_far = 100.0f; 
	scene.projection = projection_perspective(field_of_view, aspect, z_near, z_far); 
}
void window_size_callback ( GLFWwindow * , int width , int height ) { glViewport ( 0 , 0 , width , height ) ; float const aspect = width / static_cast < float > ( height ) ; float const field_of_view = 50.0f * pi / 180.0f ; float const z_near = 0.1f ; float const z_far = 100.0f ; scene . projection = projection_perspective ( field_of_view , aspect , z_near , z_far ) ; }
Function called every time the screen is resized
Function called every time the screen is resized
// The image is displayed on the entire window // Aspect ratio of the window // Generate the perspective matrix for this aspect ratio // the angle of the field of view // closest visible point // furthest visible point