Program Due:

Milestone 1: Thurs, Oct 17th in class 7.5% - This milestone should demonstrate the basic geometry of the scene including the room walls and floor (but no ceiling for now) along with at least 3 other objects (placeholder objects can be used where more complex objects will eventually be located). An orthographic third person “birds-eye” view with an adjustable camera is acceptable at this point to see the entire room.

Milestone 2: Thurs, Nov 14th in class 7.5% - This milestone should contain most of the geometry that will appear in the final scene (although a few placeholder objects can remain). There should be a perspective first person camera with controls that allow movement throughout the room (but not necessarily with collision detection). Lighting effects with at least 2 different lights including at least one spotlight should be present.

Final Presentation: 85% - Your final project will be demonstrated during the final exam period for the course (see the schedule). MAKE SURE to complete the self-evaluation form and submit it with your project. Late assignments will NOT be accepted. Your entire project folder will be uploaded to a shared Google Drive after you have presented your demo.

Evaluation Form Word document for the self-evaluation form.

Getting Started

Download CS370_Project.zip, saving it into the CS370_Fa24 directory.

Double-click on CS370_Project.zip and extract the contents of the archive into a subdirectory called CS370_Project

Open CLion, select CS370_Fa24 from the main screen (you may need to close any open projects), and open the CMakeLists.txt file in this directory (not the one in the CS370_Project subdirectory). Add the line

	add_subdirectory("CS370_Project" "CS370_Project/bin")

Finally, select Reload changes which should build the project and add house to the dropdown menu at the top of the IDE window.

The skeleton project is primarily an empty source that simply draws a red cube viewed from an orthographic perspective (this may be useful as you create your geometry). There are shaders and routines provided for loading object models, building solid color buffers, building textures, and rendering color, material/lighting, and texture mapped objects. You may add any additional header files and resources (e.g. images, shaders, models) as desired.

Programming assignment

The object of this project is to do a “walk through” of a room. You should create a room with various lighting and texture mapped objects such that the user can “walk through” the room to view it from different locations/orientations (the basis of a fps).

Hints

START EARLY! You should be developing the scene incrementally such that you always have a working program prior to adding an additional feature.

Some embellishment suggestions:

Most of all - HAVE FUN! and be creative with this project.

First Person Camera

In order to accomplish a first person camera where the controls move or rotate the camera along the viewing direction, we will use an approach similar to the spherical coordinates discussed in Lab 6. We will use an azimuth angle, θ, to create the center point relative to the eye coordinates which will define a vector for the direction the camera is facing. Thus when we move forward or backward, we will simply update eye along this direction (with a corresponding update of center). Rotation will then involve an update of the angle θ and only a corresponding recalculation of center since it does not involve a change in camera position, i.e. eye doesn’t change.

From a top down view

Camera Diagram

we can compute the coordinates of center (whenever we adjust eye or change θ) as

centerx = eyex + cos(θ)

centery = eyey

centerz = eyez + sin(θ)

To move along the current direction, we first compute a direction vector (which we can do using vector math operations) as

dir = center - eye

Then we can update eye along dir by a step size Δ (again using vector math operations) as

eye = eye + dir

Since eye has changed, center will need to be updated as described above.

Adjusting the camera to look up/down can be done by adjusting the y component of center with an elevation angle (typically without adjusting the y component of eye).

Thus the steps to implement the first person camera are:

Global variables

Set eye and θ to initially position the camera in the room and set the angle it is facing

Main

Compute center based on eye and θ using the equations above

Keyboard callback

if A/D

Update θ

if W/S

Compute dir using the equation above

Update eye using the equation above

Update center using the equations above

Grading Criteria

The program MUST compile to receive any credit (so develop incrementally).

The program will be graded based on the number of features implemented along with the creativity used to implement each one.

Compiling and running the program

You should be able to build and run the program by selecting house in the dropdown box in the toolbar and clicking the small green arrow next to it.

Final Project Window

To quit the program simply close the window.

Submitting

After you have demonstrated your final project, upload the entire project file to Google Drive. RENAME THIS FOLDER with your ycp username before uploading it to Google Drive.

DO NOT submit the project through Marmoset.

You are responsible for making sure that your submission contains the correct file(s).