GithubHelp home page GithubHelp logo

amanshenoy / mesh-viewer Goto Github PK

View Code? Open in Web Editor NEW
31.0 4.0 10.0 104.1 MB

An interactive mesh viewer (for '.obj' files) using OpenGL and GLSL

License: MIT License

CMake 2.09% GLSL 8.90% C++ 83.39% C 5.62%
opengl phong-lighting-model opengl-pipeline glsl meshviewer

mesh-viewer's Introduction

Object / Mesh Viewer

The following repository contains the implementation of a basic mesh/object viewer for .obj files. The project has been implemented in C++ using OpenGL and GLSL. This project was largely pursued to be able to get familiar with OpenGL and GLSL. The project uses the typical OpenGL rendering pipeline and uses the phong lighting model for lighting calculations.

Usage

A sample binary has been uploaded with the repo (compiled on x86, as a 64 bit application), but its unlikely that it would generally work even on a system with the same configuration (try anyway, it just might).

To compile, create a directory called build and create Makefile using the cmake build system

mkdir build && cd build
cmake ..
make

Once the project is compiled, the binary is directed to a bin directory, and takes the .obj mesh as a command line argument

./bin/viewer objects/bunny.obj 

The text newlines and messages have been hardcoded for full HD (1920x1080) resolution, but lower resolutions should not really be a problem.

Tweakable: Render Mode

One of Smooth, Lines, Point Cloud, Mesh

Tweakable: Reflective Properties

Sliders for Ambient, Diffuse, Specular, Shininess (in accordance to Phong Lighting model), and a checkbox for activating RBG inputs for the above sliders

Tweakable: Input devices

Keyboard or Mouse, for Translation and Rotation (Alternate)

Tweakable: Camera

Same thing as using mouse to move object around, but finer control

Tweakable: Lighting

RGB and XYZ Sliders for 5 light sources, 4 of which are off by default

Dependencies and Other Stuff

The project uses glm for maths, ImGui for the GUI and GLFW as the windowing library. GLEW was used to access OpenGL. The folder objects has a fair few objects to be able to play around with. Most of these were downloaded from here and were corrected using Meshlab.

mesh-viewer's People

Contributors

amanshenoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.