Due: Monday Aug 9th 23:59:59 PDT
You will write the OpenGL rendering and interaction part of a very simple game engine. We supply you with the geometry and textures of 5 maps from the Half-Life series, and we load this into an internal mesh structure for you. Your responsibility is to render this map, and allow the user to fly through it.
IMPORTANT, LICENSING ISSUES: This project uses maps from the Half-Life commercial engine. We are supplying this, and using it, in a purely educational manner. YOU ARE NOT ALLOWED TO REDISTRIBUTE ANY OF THIS DATA, OR USE IT FOR ANYTHING BEYOND THIS CLASS. In an effort to make the course relevant and interesting we are supplying you this data, but all copywrite is still held by Valve Inc.
This project includes both the programming of an OpenGL application, as well as the more trial-and-error process of configuring your program to open with a reasonable view of the map you're loading. We suggest working through features in the order listed.
OBJFace
(See MeshInfo.h)materialId
integer on OBJFace
corresponds to the index of this polygon's material inside the materials
array inside OBJMesh
Shader::setUniform
to pass uniforms to the shader variables you create._m
.materialId
int on OBJFace corresponds to the index of the materials
array holding the specific texture map information for this polygon. Use Common.h's createGLTexture
function to convert an image loaded with FreeImage (an FIBITMAP) to an OpenGL texture stored on the GPU, and store the texture id using the variable we provide on the material class.We will be awarding extra credit up to 25% of the project total. We will be awarding credit roughly proportional to the order of these ideas:
To start off, please read the MeshInfo.h
header file that describes the whole internal mesh format. Understand how to access different types of elements - there is some sample code in Scene.cpp that shows you how to query the mesh for data.
Look at int main()
to see all the OpenGL configuration we do.
TODO comments appears inside the code. Fill things in here. If you need to go beyond the skeleton or modify things to your own liking, feel free to do so.
You will find the following resources useful in completing this project:
Download here. Aug 4 (enabled depth test (z-buffering) and 2D texturing in setup, and fixed function names in Camera.h)
Maps download here. (sunet id required)
We provide you with 5 maps. You can set the values of your material properties at your discretion. You need to submit two images and text files for each map, with the following names (replacing [nr] with the map number):
map[nr].startup.png
shows the view when your program opens.map[nr].interesting.png
shows a view you liked. This will be judged subjectively.map[nr].interesting.transform.txt
contains a text representation of the cameraToWorld transform you get by writing cameraToWorld to stdout at the interesting view's location.map[nr].interesting.command.txt
contains only the material properties you passed on the command line (thus, the last 5 arguments)