Institute of Computer Science
  1. Courses
  2. 2024/25 fall
  3. Computer Graphics (MTAT.03.015)
ET
Log in

Computer Graphics 2024/25 fall

  • Main
  • Lectures
  • Practices
  • Projects
  • Exam
  • Results
  • Links

Wall Carving

Karl Afanasjev, Kaarel Parve, Simon Prii

Repository link: https://github.com/ui-1/wallcarving

Linux executable

Windows executable

The goal was to have a dynamically generated wall that can be "mined into". Clicking somewhere on the wall adds new vertices and edges into a graph structure that is then used to (re)generate the wall geometry. In the end, this is what we got implemented:

  • WASD + mouse to move and look around
  • A wall class that regenerates its VAO when (and only when) any of its vertices or edges have changed
  • Mouse click finds the position that was clicked on the wall (Möller–Trumbore)
  • Clicking on the wall pushes a hole into it

When user clicks on the geometry then a wall changing algorithm is invoked which changes the mesh based on the position of the click in 3D space. It moves vertices away from the click and splits edges that got too long in the process, therefore adds new vertices. The algorithm is described fairly well with the following picture series.

The geometry of the wall is stored in a class that keeps track of all the data it needs and provides methods to modify it:

  • vertices as a vector of vec3's
  • edges as a n x n matrix of booleans where edges[i][j] == true iff vertices with the indexes i and j are connected
  • methods to add, set, and remove vertices
  • methods to set and check whether or not two vertices are connected
  • a rendering method to be called in the main loop

A boolean value is used as a "flag" to keep track of whether or not anything significant has changed in the wall's structure -- it's set to true whenever vertices are added, for example. That way, we can re-render the wall's geometry if and only if there is any actual need to do so. The method called from the program's main loop creates a new VAO and sets the boolean back to false.

Example of clicking on the wall:

https://docs.google.com/presentation/d/1IB57H-UFymUFCvWBqriyKMp2COcSwvv8/edit?usp=sharing&ouid=105441826697917818284&rtpof=true&sd=true

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment