Moon Lab

In this lab you will add a first-person camera interface to a renderer so that the user can move around the scene with the keyboard and mouse.

Texture Coordinates

Your first challenge is to set up a scene and visualize the texture coordinates. Follow these steps:

Render a quadrilateral representing the ground. Color it by its texture coordinates.
Add a first-person camera so you can move around the scene with WASD and the mouse.
Render a sphere representing the moon. The function generateSphere has been included in the starter code. Use the latitude and longitude indices to give it texture coordinates. Use the same shader program that you used for the ground.
Show your class to your instructor to receive credit.


Your second challenge is to add textures onto the ground and moon. Follow these steps:

Download a seamless grass texture like this public domain image from Open Game Art.
Download this moon image from NASA. 1024x512 is a reasonable resolution.
Read in your textures and associate them with different texture units.
Apply the textures to the models.
Show your instructor your working renderer to receive credit.