https://github.com/abinashmeher999/opengl-texture-mapping
https://github.com/abinashmeher999/opengl-texture-mapping
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/abinashmeher999/opengl-texture-mapping
- Owner: abinashmeher999
- Created: 2016-03-10T10:48:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-07T07:14:19.000Z (about 9 years ago)
- Last Synced: 2025-04-02T13:48:40.754Z (6 months ago)
- Language: C++
- Size: 5.44 MB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# opengl-texture-mapping
This project aims at mapping various textures (bmp images) onto objects specified in the .obj format.
### Features implemented
- Viewing .obj files in a window, with rotate and scale enabled
- Specular, ambient and diffused illumination implemented
- Texture mapping has been implemented with the following parameters:
- `GL_REPEAT`
- `GL_CLAMP_TO_BORDER`
- The texture coordinates have been generated using two different algorithms:
- Planar Mapping
- Spherical MappingAny combination of the above metrics can be used to obtained various kinds of texture mapping, some of which have been provided as examples.
- The style of mapping can be modified by changing the third parameter of the function call `glTexParameteri` in texture.cpp to any of `GL_REPEAT`, `GL_CLAMP_TO_BORDER`, `GL_CLAMP_TO_EDGE`,`GL_MIRRORED_REPEAT`### Library dependencies
- lGL
- glut
- GLEW
- glm*Please have a look at the Makefile too to know what all libraries are being linked*
### Demo Scripts
- `fixed_linear.sh`
- `projective_linear.sh`
- `reflective_sphere.sh`
- `static_sphere.sh`*Note: Remember to give the file executable permissions before executing.*
### Execution
The main executable is the `texture-mapping` whose commandline parameters take an `.obj` file, the vertex and fragment shaders and the bitmap ti be used as texture.
```bash
./texture-mapping
```Rotation of the object happens as expected with the left mouse button and then dragging it. To pan press `F1` and then `F2` and then use the arrow keys. Use the `Home` key to reset the view.