Simple obj file viewer with texture using OpenGL
Scop is 42 project that involves the implementation of obj file viewer using OpenGL 3.3.
The 3D model is displayed in perspective view, rotating on itself. A texture is also applied to it.
No other libraries were used except for window management (GLFW).
Clone the repository:
# Clone this repository
git clone https://github.com/bbordere/scop42.git
# Go into the repository
cd scop42
You simply have to run:
make
To run the program:
./scop <path_to_obj_file> <path_to_texture_file>
If no argument is provided, the program starts with default cube and default texture. If one argument is provided, the programs starts with loaded model and default texture.
The texture file must be in bmp
format uncompressed.
There are example models and textures in models
and res
folders.
Texture
: Apply texture on modelUV Mapping
: Only for objects that don't have itNormals Computation
: Only for objects that don't have itMesh Triangulation
: Objects can be rendered regardless of its faces layoutLighting and Shadows
: Phong model with shadow mapReflection
: Object texture is replaced by chrome or reflective materialLandscape Skyboxes
: There are 4 landscapes available with different light settingsWireframe
: Object can be rendered as a wireframe or a point cloudDrag and Drop
: You can drag and drop models and textures inside window
WASD
: Move the camera in worldLeft/Right Arrow
: Rotate the cameraCtrl-l/Shift
: Move down/up the cameraEsc
: ExitF1-F4
: Change landscapeR
: Toggle Model RotationT
: Toggle Wireframe modeU
: Toggle UV Sphere ProjectionF
: Reset camera positionG
: Toggle SkyboxC
: Toggle Reflection ShaderB
: Toggle Bounding Box renderingN
: Toggle Normals renderingSpace
: Toggle Triangle color mode