Skip to content
An OpenGL project using glfw & glad
C++ C CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Images
glm
README.md
Shader.h
basiclightingfs.txt
basiclightinglampfs.txt
basiclightinglampvs.txt
basiclightingvs.txt
bunny.poly
camera.h
container.jpg
container2.png
container2_specular.png
glad.c
lightingcasterslampvs.txt
lightingcastersvs.txt
main.cpp
materialsfs.txt
materialslampfs.txt
materialslampvs.txt
materialsvs.txt
multiplelightsfs.txt
multiplelightslampfs.txt
multiplelightslampvs.txt
multiplelightsvs.txt
stb_image.h
teapot.poly
transformfs.txt
transformvs.txt

README.md

OpenGLProject

This is an Computer graphic class project using glad, glfw, glm

Demo https://www.youtube.com/watch?v=ZYtrCOHmLak&feature=youtu.be

Make sure your have configured glad and glfw to run these code.

Features:

  • Import model from files
  • Translation, rotation with model
  • Control the camera position
  • Add spotlights, direction lights and point lights
  • Increase or decrease the number of point lights
  • Dynamic point lights (point light position can move around)
  • Add different material to the model

Import Model

To import a model into this application is very easy. Users just need to drag a file to this window and a model will be displayed in this window.

image

Transformation

• N – Enable transformation shader (press again will disable and set the location of model to default) • Press 1,2,3 to Rotate • Press 4,5,6,7 – to translation image

Camera

To control the camera, need to enable material shader first, because the code of control camera is in material shader, press Z to enable material shade.

  • W – move forward
  • S – move backward
  • A – move left
  • D – move right
  • E – move down
  • T – move up
  • Mouse input

image

Material

  • Z - add material and one light
  • M - Bronze material
  • P - White plastic material
  • C - Ruby Material
  • O - Dynamic Material

image

image

Lighting

  • V - Disable all the shaders
  • X – Enable Multiple lights, direction lights and points light
  • Press mouse left button or right button to increase or decrease the number of points lights.
  • Z – Enable Dynamic point light (need to press V to disable lighting shader)
  • R – show rotate light. image image
You can’t perform that action at this time.