Skip to content

goto-c/OpenGL

Repository files navigation

OpenGL Demo

"OpenGL Demo" is a demonstration of showing objects with OpenGL.
This projects uses the model downloaded here.

C/C++ CI

Main project 【03_ShowObj】

The main demo is 03_ShowObj. This project shows the full image of object wrriten in OBJ files.

demo

■1st : Vertex

Firstly the image without normal/texture data is shown. This image is mapped only with vertices' information.

demo

■2nd : Normal

The next step is shading. By using normal vectors' data, the object's shades is added.

demo

■3rd : Texture

Finally, the object is covered with texture, using texture coordinates and the material information in MTL file.

Quick Overview

00_HelloWorld

This project just prints "Hello World"

01_openwin

01_openwinNewGlad

02_ShowTexture

03_ShowObj

04_ShowObjWithShader

05_ScreenShot

Features

These projects use the OpenGL, GLFW, GLAD, stb_image.

Requirement

  • GLFW(Version 3.3.2)
  • GLAD(Version 3.3)
  • Xcode(Version 11.5)

Installation

You can also install GLFW here, GLAD here, but it will be easier to use git submodule update --init --recursive to use these libraries.

Usage

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.

Note

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

License

https://poly.google.com/view/3WS86lkqYFy

references

https://tokoik.github.io/GLFWdraft.pdf
https://tokoik.github.io/opengl/libglut.html "GLUTによる「手抜き」OpenGL入門"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published