"OpenGL Demo" is a demonstration of showing objects with OpenGL.
This projects uses the model downloaded here.
The main demo is 03_ShowObj. This project shows the full image of object wrriten in OBJ files.
Firstly the image without normal/texture data is shown. This image is mapped only with vertices' information.
The next step is shading. By using normal vectors' data, the object's shades is added.
Finally, the object is covered with texture, using texture coordinates and the material information in MTL file.
This project just prints "Hello World"
These projects use the OpenGL, GLFW, GLAD, stb_image.
- GLFW(Version 3.3.2)
- GLAD(Version 3.3)
- Xcode(Version 11.5)
You can also install GLFW here, GLAD here, but it will be easier to use git submodule update --init --recursive
to use these libraries.
For Mac
Clone OpenGL repository and update submodules with
git clone https://github.com/goto-c/OpenGL.git
cd OpenGL
git submodule update --init --recursive
Compile glfw with
cd 3rd_party/glfw
cmake .
make
Make build directory in OpenGL.
cd ../../
mkdir build
cd build
Use cmake
cmake -G Xcode ..
You will find Xcode project file in OpenGL/build directory. Open the project file, then you can try every project.
I tested environments under Mac, not under Linux and Windows.
If you are a windows or Linux user, following scripts will help you.
For Windows / For Linux
https://poly.google.com/view/3WS86lkqYFy
https://tokoik.github.io/GLFWdraft.pdf
https://tokoik.github.io/opengl/libglut.html "GLUTによる「手抜き」OpenGL入門"