Skip to content

C++ renderer, with various mesh modification algorithms

License

Notifications You must be signed in to change notification settings

jasonlmfong/Model-Modifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Model-Modifier

Sample smoothed star rendering

GitHub license

This repository contains my C++17 and OpenGL implementation of a mesh viewer for .obj files, with various algorithms for interacting with the meshes, and various shading techniques.

Features

  • Objects
    • Custom .obj parser
    • Triangulation
      • Minimum cost polygon triangulation
  • Dynamic object selection
    • Simple geometric objects
    • Complex test objects
    • Automatic rescaling
    • Caching
  • Mesh modification algorithms
  • Shading options
    • Flat shading (Per-face normals)
    • Smooth shading (Per-vertex normals)
    • Mixed shading (Per-Corner normals)
  • Shader options
  • Material controls
    • Ambient
    • Diffuse
    • Specular
    • Shine
  • Lighting controls
    • Position
    • Color
    • Multiple lights
  • Render modes
    • Mesh polygons
    • Wireframe
    • Point cloud
  • Interactivity
    • Rotate model
    • Move camera
    • Rotate camera
  • Information
    • Framerate counter
    • Number of polygons in current mesh
  • Screenshot to PNG

Image Gallery

Comparison of different shading techniques

Sample armadillo rendering 1

Armadillo mesh, Blinn-Phong shader, not smoothened

Sample armadillo rendering 2

Armadillo mesh, Cook-Torrance shader, not smoothened

Sample armadillo rendering 3

Armadillo mesh, Cel shader, not smoothened

Comparison of different subdivision surface algorithms

Sample cow rendering 1

Cow mesh, Normal shader, not smoothened

Sample cow rendering 2

Cow mesh, Normal shader, smoothened 1 time with Catmull-Clark subdivision

Sample cow rendering 3

Cow mesh, Normal shader, smoothened 1 time with Doo-Sabin subdivision

Sample cow rendering 4

Cow mesh, Normal shader, smoothened 1 time with Loop subdivision

Dependencies

  • GLFW
  • GLM
  • Dear ImGui

List of 3D Models Used

Here I try to list all sources wherever possible.

Geometric models

Model Name Source
Crumpled Keenan Crane
Cube Me
Double Torus Geometry Collective
Fandisk CAD part Pratt & Whitney/Hughes Hoppe
Icosahedron John Burkardt
Octahedron John Burkardt
Oloid Keenan Crane
Sphere Geometry Collective
Star Unknown
T-shape Me
Torus Geometry Collective
Tubes Me

Test models

Model Name Source
Ankylosaurus Unknown
Armadillo Stanford
Bob Keenan Crane
Bunny Stanford
Cow Viewpoint Animation Engineering / Sun Microsystems
Cow head Geometry Collective
Face Geometry Collective
Gargoyle Geometry Collective
Kitten Geometry Collective
Shuttle John Burkardt
Suzanne Blender
Teapot Martin Newell
Teddy Unknown