Explore the solar system

| Oct 23, 2020

Context:

IGR201a: 3D application development/ OpenGL intro

Lab Assignment:

The lab consists in creating a simple solar system animation (3 bodies: sun + earth + moon) in OpenGL.

Github repository

Lab report

Setup:

Lab Materials (basic code to run an empty window) + Lab Assignment + learnopengl’s tutorials

C++/ Visual Studio 2019/ GLFW/ GLAD/ GLM

State:

finished

Objectives successfully achieved:

→ rendering a single triangle: using vertex buffer and index buffer.

→ coloring the triangle: adding a color buffer and updating the shaders

→ rendering correctly a sphere: transforming a plane mesh to a sphere mesh

→ creating the Mesh class

→ implementing the Phong shading model

→ implementing different model matrices to the same mesh to render multiple spheres

→ modifying the model matrices to animate the sphere (using glfwGetTime)

→ mapping a texture to the model instead of the color buffer

→ adding a camera mode feature and implementing a simple version of fly like camera: the user can place the camera and the look-to vector to any body (earth, moon, sun) or to a fixed point in space.

Screenshots:

i1 i2

i3 i4

New Skills:

  • Setting up an OpenGL project (linking libraries/ managing include files) with Visual Studio
  • Understanding the fundamentals modern OpenGL’s rendering pipeline
  • Understanding the different Coordinate Systems (local->world->view->clip->screen)
  • Creating a window
  • Generating a mesh and rendering it
  • Mapping a terxture
  • Applying transformations (math calculations using GLM)
  • Writing shaders to implement the Phong model
comments powered by Disqus