This was a project done in relation to an exam I had in IMT2531 Computer Graphics at NTNU Gjøvik. It is an OpenGL implementation in C++. Content of the README from the repository can be seen below:

IMT2531_Graphics_Exam

Graphics exam done in OpenGL for IMT2531 at NTNU

Author

To build:

  • Clone repository
  • Run CMake
  • Set solution properties to single startup project “GraphicExam” (Visual Studio)
  • Build with compiler (Debug, Win32)

Note: CMake probably only works on Windows, and I have only built with Visual Studio with CMake

To run from .exe:

  • Go to folder Executable -> Release
  • Run GraphicsExam.exe

Keybindings

Camera

  • - Cycles between camera modes (Glider, First-Person Glider, Free-Roam, and Restricted-Cam)
  • I Forward (Free-Roam) or Z movement (Restricted-Cam)
  • K Backwards (Free-Roam) or -Z movement (Restricted-Cam)
  • J Left (Free-Roam) or X movement (Restricted-Cam)
  • L Right (Free-Roam) or -X movement (Restricted-Cam)
  • Y Y movement (Restricted-Cam)
  • H -Y movement (Restricted-Cam)
  • Zoom in and out with scroll-wheel
  • Move mouse around to change view orientation

Glider

  • W Pitch Up
  • S Pitch Down
  • A Roll Left
  • D Roll Right
  • , Increase speed
  • . Decrease speed
  • R Reset to original position
  • F Teleport to new random position

Seasonal Change

  • 1 Toggles ‘Winter’
  • 2 Toggles ‘Spring’
  • 3 Toggles ‘Summer’
  • 4 Toggles ‘Autumn’
  • 5 Pauses seasonal change
  • O Toggles contour lines
  • Increase lerp on zones
  • Decrease lerp on zones

Time Change

  • 6 Toggles ‘Night’
  • 7 Toggles ‘Morning’
  • 8 Toggles ‘Noon’
  • 9 Toggles ‘Afternoon’
  • 0 Pauses time change

Feature List

Heightmap/Terrain

  • Loading heightmap with usage of stb_image
  • Showing proper vegetation with smooth transitions between zones (water - grass - mud - snow)
  • Contour lines can be toggled

Camera

  • 3rd person Glider mode
  • First person Glider mode
  • Free-Roam mode
  • Restricted-Movement mode
  • Zoom in/out

Seasonal / Time-of-Day change

  • Seasons cycle automatically between Winter - Spring - Summer - Autumn
  • Season and month is printed on top left corner
  • Time-of-day cycles between Night - Morning - Noon - Afternoon
  • Time-of-day is printed as a 24 hour clock on top right corner
  • Rising water levels in Spring

Glider

  • Glider model loaded with .obj (extracted with blender from the .blend file)
  • WASD for controls (Pitch and roll)
  • Speed increase with ‘,’ and decrease with ‘.’
  • 3rd person and First-Person perspective, change with ‘-’
  • ‘F’ changes the current position of the glider to a random position
  • ‘R’ resets the glider position to it’s original position
  • Glider showing proper specular lighting

Some additional

  • ‘Skybox’ rendered around everything
  • ‘Up’ and ‘Down’ arrows changes the interpolation value between zones

Images

Sources:

Heightmap Loading https://www.3dgep.com/multi-textured-terrain-in-opengl/#The_Terrain::LoadHeightmap_Method

Heightmap Loading https://stackoverflow.com/questions/48286572/opengl-heightmap-terrain-and-normals-with-low-resolution

Heightmap Loading http://www.bluemoonproductions.nl/tutorials/3d-terrain-using-a-heightmap/

Skybox https://learnopengl.com/Advanced-OpenGL/Cubemaps

Assimp Materials http://assimp.sourceforge.net/lib_html/materials.html

Calculating ‘up’ vector from rotation https://stackoverflow.com/a/1121731

Blending for transparency https://learnopengl.com/Advanced-OpenGL/Blending