Skip to content

University Computer Graphics Project Written In C++ Using OpenGL

Notifications You must be signed in to change notification settings

Mattiemus/Graphics

Repository files navigation

Computer Graphics Coursework

This was a piece of software written for a computer graphics module I took while attending university.

Screenshot

Lighting

As 3D rendering is essentially just a simulation of lighting bouncing around a scene, great care was taken with the lighting engine. The Phong lighting model was implemented in HLSL, which defines how light should diffuse around an object, and how to compute specular highlights.

Screenshot Screenshot

Texturing and Shaders

Textures were used to define the individual components in the lighting simulation. The shaders take in maps for the diffuse colour, the surface normal, and the specular highlights. These maps are then combined into a material. A material is a single shader, with its input bindings (i.e. textures, camera matrices, etc.). These maps are loaded using SDL, by reading the texture file as a surface, then loading the byte array into OpenGL.

Screenshot

Screenshot

Animation

The scene has two key animated parts, both the grass and the planetary model. You can see the grass, which sways in the wind, by transforming the tips of the grass according to sin(elapsedTime). The second animated component is the planetary model, shown above, which makes use of hierarchical modelling to rotate the planets both around the centre column, and the moons around there parent planet. This is done by simply rotating the object around there origin axis (the very end of their arm).

Screenshot Screenshot

About

University Computer Graphics Project Written In C++ Using OpenGL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published