Skip to content

harfangeek/MeshEditor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build & Test SonarQube Coverity
master Build Status Quality Gate Status
Coverage
N/A
develop Build Status Quality Gate Status
Coverage
Coverage

MeshEditor

Presentation

A simple mesh editor in C++. Import an .obj model and edit it or create one from scratch.

This project is mostly educational. Even if I try to develop it as seriously as possible, it will not fill any user need.

This project is for me a laboratory to experiment following topics:

  • Modern OpenGL (>= 3.3)
  • 3D computation and related algorithms and data structures
  • Software architecture
  • Modern C++ features
  • Makefiles and multi-OS support
  • Git workflows
  • Continus Integration

If you are interested in any of these topics you may find something interesting in this project. All critics and suggestions are of course welcome.

The goal of this project is to implement myself things I am interested in, in order to understand beneath concepts. I implemented myself all 3D data structures and algorithms. I am only relying on OpenGL for rendering and GLM for basic maths objects (vectors and matrices).

The project has been built and tested on Windows 7 64bits (both 32 and 64bits build with MSVC++ and Mingw-w64) and on Debian 9 64bits (both 32 and 64 bits build with gcc/g++ and clang/clang++)

Project Dependencies

For convenience, all dependencies are shipped with the project. They also are automatically built before building the project so you should not worry about them.

System Dependencies

Windows

The OpenGL library should be provided by your system or your graphic card driver.

Linux

Some packages need to be installed, instructions for Debian 9 64 bits:

Minimum install: apt install libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev

You can instead install full X.org meta package: apt install xorg-dev

The OpenGL library should be provided by your graphic card driver.

Building

The project can be built using the provided Visual Studio project on Windows, or using the provided Makefile on both Linux and Windows (see below). The executable is generated in the project root folder. Shaders files needed by the executable at runtime are automatically copied in the project root folder from the sources folder. This project needs a compiler supporting C++17 features. The project has been test with:

  • MSVC >= v141
  • GCC >= 6.3
  • Clang >= 6.0

The project binary is generated in the MeshEditor project folder and must be executed from there. To export the program, copy the executable and the "resources" folder.

Visual Studio (Windows)

Open the project, chose your configuration (debug/release, x86/x64), build the solution. Project dependencies are configured to be automatically built before building the program. The project has been created with Visual Studio Community 2017.

Makefile (Linux and Windows)

Go to the project root and execute make. The Makefile has been tested on:

  • Windows 7 64bits using Mingw-w64. The Makefile can be executed from a standard Windows CMD and from Git Bash.
  • Debian 9 64bits using gcc/g++ and clang/clang++

Some options are tweakable. Two examples:

  • 32 bits binary with debug info with clang/clang++: make CC=clang CXX=clang++ MODE=debug ARCH=x86
  • 64 bits binary with optimization with gcc/g++: make CC=gcc CXX=g++ MODE=release ARCH=x64

The second one is the default when simply invoking make. Add the "-jX" option to speed up the build, with X beeing the number of parallel jobs.

The project Makefile automatically list all .cpp files so it is not needed to edit it when adding new files.

Unit tests

Continus Integration

Workflow

The master and develop branches are automatically built and tested on push using Travis-CI. The following configurations are tested:

  • Linux with gcc
  • Linux with clang
  • Windows with mingw64-gcc
  • Windows with MSVC

For all configurations only the Release/x64 target is tested.

If all builds pass, the code is scanned using SonarQube analyzer and the result is pushed to SonarCloud along with the coverage results from unit tests.

The code is also scanned by Coverity, a static code analyzer. This analysis is not needed at every push, and is limited per month. The Coverity scan is configured to be launched when pushing to the coverity branch only. It is a dummy branch where I merge the develop branch when the code has significantly changed to trigger a new analysis.

Build status

Build & Test SonarQube Coverity
master Build Status Quality Gate Status
Coverage
N/A
develop Build Status Quality Gate Status
Coverage
Coverage

References

This project being mostly educational, here are some references for the different topics I'm experimenting in this project.

Architecture

Modern C++

OpenGL

Algorithm

Makefile

Git Workflows

Continus Integration

ToDo List

  • GUI

    • Viewer options panel (Render mode, show normals, perspective mode, ...)
    • Object properties panel (translation, rotation)
    • Load/Save panel
    • Selection panel
    • 3D Manipulator
  • Rendering

    • Better usage of VAOs
    • Multiple objects rendering
    • Lights
  • Algorithm

    • Selection
      • Selection of a face
      • Selection of an edge
      • Selection of an object
    • Mesh geometry
      • Split face (cut a face into two faces)
      • Poke face (create new faces from one face by adding a vertex at the center)
      • Remove edge (merge two faces)
      • Extrusion of a face
    • Mesh transformation
      • Smoothen mesh
      • Mesh improvement (Catmull Clarck algorithm)
      • Mesh simplification
    • Mesh creation
      • Create a cube, sphere, pyramid, ...

Ideas to experiment

  • Implement some iterators for the Mesh data model
  • Geometry Shader
  • Compute Shader
  • Some multithreading
  • Draw a Skybox
  • Draw a grid
  • Textures/materials
  • Objects reflection
  • Multiple windows (multiple views, synchronized views, ...)
  • Optimize the mouse selection (using Bounding Volume Hierarchies)
  • Mesh reconstruction (construct a mesh from its vertices only, used in 3D scanner)
  • Undo/redo for some features
  • Mesh physics (Mass-Spring System)

About

A simple mesh editor. Import an .obj model or create one from scratch.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published