├── 0 ├── CMakeLists.txt └── main.cpp ├── 1 ├── CMakeLists.txt ├── Triangle.cpp ├── Triangle.hpp ├── main.cpp ├── rasterizer.cpp ├── rasterizer.hpp └── readme.md ├── 2 ├── CMakeLists.txt ├── Triangle.cpp ├── Triangle.hpp ├── global.hpp ├── main.cpp ├── md_image │ ├── SSAA2.png │ ├── SSAA3.png │ └── naive.png ├── rasterizer.cpp ├── rasterizer.hpp └── readme.md ├── 3 ├── CMakeLists.txt ├── OBJ_Loader.h ├── Shader.hpp ├── Texture.cpp ├── Texture.hpp ├── Triangle.cpp ├── Triangle.hpp ├── global.hpp ├── images │ ├── crate │ │ ├── bump.png │ │ ├── displacement.png │ │ ├── normal.png │ │ ├── phong.png │ │ ├── texture1.png │ │ └── texture2.png │ ├── cube │ │ ├── bump.png │ │ ├── displacement.png │ │ ├── normal.png │ │ ├── phong.png │ │ ├── texture.png │ │ └── texture1.png │ ├── spot │ │ ├── bump.png │ │ ├── displacement.png │ │ ├── normal.png │ │ ├── phong.png │ │ └── texture.png │ ├── texture-2itplt.png │ └── texture-noitplt.png ├── main.cpp ├── models │ ├── Crate │ │ ├── Crate1.3ds │ │ ├── Crate1.blend │ │ ├── Crate1.mtl │ │ ├── Crate1.obj │ │ ├── CrateImage1.JPG │ │ ├── CrateImage2.JPG │ │ └── crate_1.jpg │ ├── bunny │ │ └── bunny.obj │ ├── cube │ │ ├── cube.mtl │ │ ├── cube.obj │ │ ├── wall.tif │ │ └── wall1.tif │ ├── rock │ │ ├── rock.mtl │ │ ├── rock.obj │ │ └── rock.png │ └── spot │ │ ├── README.txt │ │ ├── hmap.jpg │ │ ├── spot_control_mesh.obj │ │ ├── spot_quadrangulated.obj │ │ ├── spot_texture.png │ │ ├── spot_texture.svg │ │ ├── spot_triangulated.obj │ │ └── spot_triangulated_good.obj ├── rasterizer.cpp ├── rasterizer.hpp └── readme.md ├── 4 ├── CMakeLists.txt ├── main.cpp └── readme.md ├── 5 ├── CMakeLists.txt ├── Light.hpp ├── Object.hpp ├── Renderer.cpp ├── Renderer.hpp ├── Scene.cpp ├── Scene.hpp ├── Sphere.hpp ├── Triangle.hpp ├── Vector.hpp ├── global.hpp ├── images │ └── binary.ppm ├── main.cpp └── readme.md ├── 6 ├── AreaLight.hpp ├── BVH.cpp ├── BVH.hpp ├── Bounds3.hpp ├── CMakeLists.txt ├── Intersection.hpp ├── Light.hpp ├── Material.hpp ├── OBJ_Loader.hpp ├── Object.hpp ├── Ray.hpp ├── Renderer.cpp ├── Renderer.hpp ├── Scene.cpp ├── Scene.hpp ├── Sphere.hpp ├── Triangle.hpp ├── Vector.cpp ├── Vector.hpp ├── global.hpp ├── images │ └── binary.ppm ├── main.cpp ├── models │ └── bunny │ │ └── bunny.obj └── readme.md ├── 7 ├── .DS_Store ├── AreaLight.hpp ├── BVH.cpp ├── BVH.hpp ├── Bounds3.hpp ├── CMakeLists.txt ├── Intersection.hpp ├── Light.hpp ├── Material.hpp ├── OBJ_Loader.hpp ├── Object.hpp ├── Ray.hpp ├── Renderer.cpp ├── Renderer.hpp ├── Scene.cpp ├── Scene.hpp ├── Sphere.hpp ├── Triangle.hpp ├── Vector.cpp ├── Vector.hpp ├── global.hpp ├── images │ ├── 1-spp.ppm │ ├── 16-spp.ppm │ ├── 256-spp-microfacet.png │ ├── 256-spp-microfacet.ppm │ ├── 256-spp.png │ ├── 256-spp.ppm │ ├── shade-exp.png │ └── shade-func.png ├── main.cpp ├── models │ ├── bunny │ │ └── bunny.obj │ └── cornellbox │ │ ├── floor.obj │ │ ├── left.obj │ │ ├── light.obj │ │ ├── right.obj │ │ ├── shortbox.obj │ │ └── tallbox.obj └── readme.md ├── 8 ├── CGL │ ├── .gitignore │ ├── CMakeLists.txt │ ├── cmake │ │ └── modules │ │ │ └── FindGLEW.cmake │ ├── deps │ │ ├── glew │ │ │ ├── CMakeLists.txt │ │ │ ├── LICENSE.txt │ │ │ ├── include │ │ │ │ └── GL │ │ │ │ │ ├── glew.h │ │ │ │ │ ├── glxew.h │ │ │ │ │ └── wglew.h │ │ │ └── src │ │ │ │ ├── glew.c │ │ │ │ ├── glewinfo.c │ │ │ │ └── visualinfo.c │ │ └── glfw │ │ │ ├── CMake │ │ │ ├── AppleInfo.plist │ │ │ ├── amd64-mingw32msvc.cmake │ │ │ ├── i586-mingw32msvc.cmake │ │ │ ├── i686-pc-mingw32.cmake │ │ │ ├── i686-w64-mingw32.cmake │ │ │ ├── modules │ │ │ │ ├── FindEGL.cmake │ │ │ │ ├── FindGLESv1.cmake │ │ │ │ ├── FindGLESv2.cmake │ │ │ │ ├── FindMir.cmake │ │ │ │ ├── FindWayland.cmake │ │ │ │ └── FindXKBCommon.cmake │ │ │ └── x86_64-w64-mingw32.cmake │ │ │ ├── CMakeLists.txt │ │ │ ├── COPYING.txt │ │ │ ├── cmake_uninstall.cmake.in │ │ │ ├── deps │ │ │ ├── EGL │ │ │ │ └── eglext.h │ │ │ ├── GL │ │ │ │ ├── glext.h │ │ │ │ ├── glxext.h │ │ │ │ └── wglext.h │ │ │ ├── KHR │ │ │ │ └── khrplatform.h │ │ │ ├── getopt.c │ │ │ ├── getopt.h │ │ │ ├── glad.c │ │ │ ├── glad │ │ │ │ └── glad.h │ │ │ ├── tinycthread.c │ │ │ └── tinycthread.h │ │ │ ├── docs │ │ │ ├── CMakeLists.txt │ │ │ ├── Doxyfile.in │ │ │ ├── DoxygenLayout.xml │ │ │ ├── build.dox │ │ │ ├── compat.dox │ │ │ ├── compile.dox │ │ │ ├── context.dox │ │ │ ├── extra.css │ │ │ ├── extra.less │ │ │ ├── footer.html │ │ │ ├── header.html │ │ │ ├── html │ │ │ │ ├── annotated.html │ │ │ │ ├── bc_s.png │ │ │ │ ├── bdwn.png │ │ │ │ ├── bug.html │ │ │ │ ├── build.html │ │ │ │ ├── build_8dox.html │ │ │ │ ├── classes.html │ │ │ │ ├── closed.png │ │ │ │ ├── compat.html │ │ │ │ ├── compat_8dox.html │ │ │ │ ├── compile.html │ │ │ │ ├── compile_8dox.html │ │ │ │ ├── context.html │ │ │ │ ├── context_8dox.html │ │ │ │ ├── dir_2424ad704b206c89082f9408cac4dea1.html │ │ │ │ ├── dir_cad64ac143687238294d0ef1c4308bc1.html │ │ │ │ ├── dir_d0d9ff8e306589526ff939d1e8a51d35.html │ │ │ │ ├── doxygen.css │ │ │ │ ├── doxygen.png │ │ │ │ ├── dynsections.js │ │ │ │ ├── extra.css │ │ │ │ ├── files.html │ │ │ │ ├── ftv2blank.png │ │ │ │ ├── ftv2cl.png │ │ │ │ ├── ftv2doc.png │ │ │ │ ├── ftv2folderclosed.png │ │ │ │ ├── ftv2folderopen.png │ │ │ │ ├── ftv2lastnode.png │ │ │ │ ├── ftv2link.png │ │ │ │ ├── ftv2mlastnode.png │ │ │ │ ├── ftv2mnode.png │ │ │ │ ├── ftv2mo.png │ │ │ │ ├── ftv2node.png │ │ │ │ ├── ftv2ns.png │ │ │ │ ├── ftv2plastnode.png │ │ │ │ ├── ftv2pnode.png │ │ │ │ ├── ftv2splitbar.png │ │ │ │ ├── ftv2vertline.png │ │ │ │ ├── functions.html │ │ │ │ ├── functions_vars.html │ │ │ │ ├── glfw3_8h.html │ │ │ │ ├── glfw3_8h_source.html │ │ │ │ ├── glfw3native_8h.html │ │ │ │ ├── glfw3native_8h_source.html │ │ │ │ ├── globals.html │ │ │ │ ├── globals_b.html │ │ │ │ ├── globals_c.html │ │ │ │ ├── globals_d.html │ │ │ │ ├── globals_defs.html │ │ │ │ ├── globals_defs_b.html │ │ │ │ ├── globals_defs_c.html │ │ │ │ ├── globals_defs_d.html │ │ │ │ ├── globals_defs_f.html │ │ │ │ ├── globals_defs_g.html │ │ │ │ ├── globals_defs_h.html │ │ │ │ ├── globals_defs_i.html │ │ │ │ ├── globals_defs_j.html │ │ │ │ ├── globals_defs_k.html │ │ │ │ ├── globals_defs_l.html │ │ │ │ ├── globals_defs_m.html │ │ │ │ ├── globals_defs_n.html │ │ │ │ ├── globals_defs_o.html │ │ │ │ ├── globals_defs_p.html │ │ │ │ ├── globals_defs_r.html │ │ │ │ ├── globals_defs_s.html │ │ │ │ ├── globals_defs_v.html │ │ │ │ ├── globals_e.html │ │ │ │ ├── globals_f.html │ │ │ │ ├── globals_func.html │ │ │ │ ├── globals_g.html │ │ │ │ ├── globals_h.html │ │ │ │ ├── globals_i.html │ │ │ │ ├── globals_j.html │ │ │ │ ├── globals_k.html │ │ │ │ ├── globals_l.html │ │ │ │ ├── globals_m.html │ │ │ │ ├── globals_n.html │ │ │ │ ├── globals_o.html │ │ │ │ ├── globals_p.html │ │ │ │ ├── globals_r.html │ │ │ │ ├── globals_s.html │ │ │ │ ├── globals_t.html │ │ │ │ ├── globals_type.html │ │ │ │ ├── globals_v.html │ │ │ │ ├── globals_w.html │ │ │ │ ├── group__buttons.html │ │ │ │ ├── group__context.html │ │ │ │ ├── group__errors.html │ │ │ │ ├── group__init.html │ │ │ │ ├── group__input.html │ │ │ │ ├── group__joysticks.html │ │ │ │ ├── group__keys.html │ │ │ │ ├── group__mods.html │ │ │ │ ├── group__monitor.html │ │ │ │ ├── group__native.html │ │ │ │ ├── group__shapes.html │ │ │ │ ├── group__window.html │ │ │ │ ├── index.html │ │ │ │ ├── input.html │ │ │ │ ├── input_8dox.html │ │ │ │ ├── intro.html │ │ │ │ ├── intro_8dox.html │ │ │ │ ├── jquery.js │ │ │ │ ├── main_8dox.html │ │ │ │ ├── modules.html │ │ │ │ ├── monitor.html │ │ │ │ ├── monitor_8dox.html │ │ │ │ ├── moving.html │ │ │ │ ├── moving_8dox.html │ │ │ │ ├── nav_f.png │ │ │ │ ├── nav_g.png │ │ │ │ ├── nav_h.png │ │ │ │ ├── news.html │ │ │ │ ├── news_8dox.html │ │ │ │ ├── open.png │ │ │ │ ├── pages.html │ │ │ │ ├── quick.html │ │ │ │ ├── quick_8dox.html │ │ │ │ ├── rift.html │ │ │ │ ├── rift_8dox.html │ │ │ │ ├── search │ │ │ │ │ ├── all_0.html │ │ │ │ │ ├── all_0.js │ │ │ │ │ ├── all_1.html │ │ │ │ │ ├── all_1.js │ │ │ │ │ ├── all_2.html │ │ │ │ │ ├── all_2.js │ │ │ │ │ ├── all_3.html │ │ │ │ │ ├── all_3.js │ │ │ │ │ ├── all_4.html │ │ │ │ │ ├── all_4.js │ │ │ │ │ ├── all_5.html │ │ │ │ │ ├── all_5.js │ │ │ │ │ ├── all_6.html │ │ │ │ │ ├── all_6.js │ │ │ │ │ ├── all_7.html │ │ │ │ │ ├── all_7.js │ │ │ │ │ ├── all_8.html │ │ │ │ │ ├── all_8.js │ │ │ │ │ ├── all_9.html │ │ │ │ │ ├── all_9.js │ │ │ │ │ ├── all_a.html │ │ │ │ │ ├── all_a.js │ │ │ │ │ ├── all_b.html │ │ │ │ │ ├── all_b.js │ │ │ │ │ ├── all_c.html │ │ │ │ │ ├── all_c.js │ │ │ │ │ ├── all_d.html │ │ │ │ │ ├── all_d.js │ │ │ │ │ ├── all_e.html │ │ │ │ │ ├── all_e.js │ │ │ │ │ ├── all_f.html │ │ │ │ │ ├── all_f.js │ │ │ │ │ ├── classes_0.html │ │ │ │ │ ├── classes_0.js │ │ │ │ │ ├── close.png │ │ │ │ │ ├── defines_0.html │ │ │ │ │ ├── defines_0.js │ │ │ │ │ ├── files_0.html │ │ │ │ │ ├── files_0.js │ │ │ │ │ ├── files_1.html │ │ │ │ │ ├── files_1.js │ │ │ │ │ ├── files_2.html │ │ │ │ │ ├── files_2.js │ │ │ │ │ ├── files_3.html │ │ │ │ │ ├── files_3.js │ │ │ │ │ ├── files_4.html │ │ │ │ │ ├── files_4.js │ │ │ │ │ ├── files_5.html │ │ │ │ │ ├── files_5.js │ │ │ │ │ ├── files_6.html │ │ │ │ │ ├── files_6.js │ │ │ │ │ ├── files_7.html │ │ │ │ │ ├── files_7.js │ │ │ │ │ ├── files_8.html │ │ │ │ │ ├── files_8.js │ │ │ │ │ ├── functions_0.html │ │ │ │ │ ├── functions_0.js │ │ │ │ │ ├── groups_0.html │ │ │ │ │ ├── groups_0.js │ │ │ │ │ ├── groups_1.html │ │ │ │ │ ├── groups_1.js │ │ │ │ │ ├── groups_2.html │ │ │ │ │ ├── groups_2.js │ │ │ │ │ ├── groups_3.html │ │ │ │ │ ├── groups_3.js │ │ │ │ │ ├── groups_4.html │ │ │ │ │ ├── groups_4.js │ │ │ │ │ ├── groups_5.html │ │ │ │ │ ├── groups_5.js │ │ │ │ │ ├── groups_6.html │ │ │ │ │ ├── groups_6.js │ │ │ │ │ ├── groups_7.html │ │ │ │ │ ├── groups_7.js │ │ │ │ │ ├── groups_8.html │ │ │ │ │ ├── groups_8.js │ │ │ │ │ ├── mag_sel.png │ │ │ │ │ ├── nomatches.html │ │ │ │ │ ├── pages_0.html │ │ │ │ │ ├── pages_0.js │ │ │ │ │ ├── pages_1.html │ │ │ │ │ ├── pages_1.js │ │ │ │ │ ├── pages_2.html │ │ │ │ │ ├── pages_2.js │ │ │ │ │ ├── pages_3.html │ │ │ │ │ ├── pages_3.js │ │ │ │ │ ├── pages_4.html │ │ │ │ │ ├── pages_4.js │ │ │ │ │ ├── pages_5.html │ │ │ │ │ ├── pages_5.js │ │ │ │ │ ├── pages_6.html │ │ │ │ │ ├── pages_6.js │ │ │ │ │ ├── pages_7.html │ │ │ │ │ ├── pages_7.js │ │ │ │ │ ├── pages_8.html │ │ │ │ │ ├── pages_8.js │ │ │ │ │ ├── search.css │ │ │ │ │ ├── search.js │ │ │ │ │ ├── search_l.png │ │ │ │ │ ├── search_m.png │ │ │ │ │ ├── search_r.png │ │ │ │ │ ├── typedefs_0.html │ │ │ │ │ ├── typedefs_0.js │ │ │ │ │ ├── variables_0.html │ │ │ │ │ ├── variables_0.js │ │ │ │ │ ├── variables_1.html │ │ │ │ │ ├── variables_1.js │ │ │ │ │ ├── variables_2.html │ │ │ │ │ ├── variables_2.js │ │ │ │ │ ├── variables_3.html │ │ │ │ │ ├── variables_3.js │ │ │ │ │ ├── variables_4.html │ │ │ │ │ ├── variables_4.js │ │ │ │ │ ├── variables_5.html │ │ │ │ │ ├── variables_5.js │ │ │ │ │ ├── variables_6.html │ │ │ │ │ └── variables_6.js │ │ │ │ ├── spaces.svg │ │ │ │ ├── structGLFWgammaramp.html │ │ │ │ ├── structGLFWimage.html │ │ │ │ ├── structGLFWvidmode.html │ │ │ │ ├── sync_off.png │ │ │ │ ├── sync_on.png │ │ │ │ ├── tab_a.png │ │ │ │ ├── tab_b.png │ │ │ │ ├── tab_h.png │ │ │ │ ├── tab_s.png │ │ │ │ ├── tabs.css │ │ │ │ ├── window.html │ │ │ │ └── window_8dox.html │ │ │ ├── input.dox │ │ │ ├── internal.dox │ │ │ ├── intro.dox │ │ │ ├── main.dox │ │ │ ├── monitor.dox │ │ │ ├── moving.dox │ │ │ ├── news.dox │ │ │ ├── quick.dox │ │ │ ├── rift.dox │ │ │ ├── spaces.svg │ │ │ └── window.dox │ │ │ ├── examples │ │ │ ├── CMakeLists.txt │ │ │ ├── boing.c │ │ │ ├── gears.c │ │ │ ├── heightmap.c │ │ │ ├── particles.c │ │ │ ├── simple.c │ │ │ ├── splitview.c │ │ │ └── wave.c │ │ │ ├── include │ │ │ └── GLFW │ │ │ │ ├── glfw3.h │ │ │ │ └── glfw3native.h │ │ │ ├── src │ │ │ ├── CMakeLists.txt │ │ │ ├── cocoa_init.m │ │ │ ├── cocoa_monitor.m │ │ │ ├── cocoa_platform.h │ │ │ ├── cocoa_window.m │ │ │ ├── context.c │ │ │ ├── egl_context.c │ │ │ ├── egl_context.h │ │ │ ├── glfw3.pc.in │ │ │ ├── glfw3Config.cmake.in │ │ │ ├── glfw_config.h.in │ │ │ ├── glx_context.c │ │ │ ├── glx_context.h │ │ │ ├── init.c │ │ │ ├── input.c │ │ │ ├── internal.h │ │ │ ├── iokit_joystick.h │ │ │ ├── iokit_joystick.m │ │ │ ├── linux_joystick.c │ │ │ ├── linux_joystick.h │ │ │ ├── mach_time.c │ │ │ ├── mir_init.c │ │ │ ├── mir_monitor.c │ │ │ ├── mir_platform.h │ │ │ ├── mir_window.c │ │ │ ├── monitor.c │ │ │ ├── nsgl_context.h │ │ │ ├── nsgl_context.m │ │ │ ├── posix_time.c │ │ │ ├── posix_time.h │ │ │ ├── posix_tls.c │ │ │ ├── posix_tls.h │ │ │ ├── wgl_context.c │ │ │ ├── wgl_context.h │ │ │ ├── win32_init.c │ │ │ ├── win32_monitor.c │ │ │ ├── win32_platform.h │ │ │ ├── win32_time.c │ │ │ ├── win32_tls.c │ │ │ ├── win32_tls.h │ │ │ ├── win32_window.c │ │ │ ├── window.c │ │ │ ├── winmm_joystick.c │ │ │ ├── winmm_joystick.h │ │ │ ├── wl_init.c │ │ │ ├── wl_monitor.c │ │ │ ├── wl_platform.h │ │ │ ├── wl_window.c │ │ │ ├── x11_init.c │ │ │ ├── x11_monitor.c │ │ │ ├── x11_platform.h │ │ │ ├── x11_window.c │ │ │ ├── xkb_unicode.c │ │ │ └── xkb_unicode.h │ │ │ └── tests │ │ │ ├── CMakeLists.txt │ │ │ ├── accuracy.c │ │ │ ├── clipboard.c │ │ │ ├── cursor.c │ │ │ ├── cursoranim.c │ │ │ ├── defaults.c │ │ │ ├── empty.c │ │ │ ├── events.c │ │ │ ├── fsaa.c │ │ │ ├── gamma.c │ │ │ ├── glfwinfo.c │ │ │ ├── iconify.c │ │ │ ├── joysticks.c │ │ │ ├── monitors.c │ │ │ ├── peter.c │ │ │ ├── reopen.c │ │ │ ├── sharing.c │ │ │ ├── tearing.c │ │ │ ├── threads.c │ │ │ ├── title.c │ │ │ └── windows.c │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── text.cpp │ │ └── triangle.cpp │ ├── include │ │ ├── CGL │ │ │ ├── CGL.h │ │ │ ├── base64.h │ │ │ ├── color.h │ │ │ ├── complex.h │ │ │ ├── matrix3x3.h │ │ │ ├── matrix4x4.h │ │ │ ├── misc.h │ │ │ ├── osdtext.h │ │ │ ├── quaternion.h │ │ │ ├── renderer.h │ │ │ ├── tinyxml2.h │ │ │ ├── vector2D.h │ │ │ ├── vector3D.h │ │ │ ├── vector4D.h │ │ │ └── viewer.h │ │ ├── GL │ │ │ ├── glew.h │ │ │ ├── glxew.h │ │ │ └── wglew.h │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ ├── src │ │ ├── CGL.h │ │ ├── CMakeLists.txt │ │ ├── base64.cpp │ │ ├── base64.h │ │ ├── color.cpp │ │ ├── color.h │ │ ├── complex.cpp │ │ ├── complex.h │ │ ├── console.h │ │ ├── matrix3x3.cpp │ │ ├── matrix3x3.h │ │ ├── matrix4x4.cpp │ │ ├── matrix4x4.h │ │ ├── osdfont.c │ │ ├── osdtext.cpp │ │ ├── osdtext.h │ │ ├── quaternion.cpp │ │ ├── quaternion.h │ │ ├── renderer.h │ │ ├── tinyxml2.cpp │ │ ├── tinyxml2.h │ │ ├── vector2D.cpp │ │ ├── vector2D.h │ │ ├── vector3D.cpp │ │ ├── vector3D.h │ │ ├── vector4D.cpp │ │ ├── vector4D.h │ │ ├── viewer.cpp │ │ └── viewer.h │ └── tests │ │ ├── CMakeLists.txt │ │ └── osd.cpp ├── CMakeLists.txt ├── readme.md └── src │ ├── CMakeLists.txt │ ├── application.cpp │ ├── application.h │ ├── main.cpp │ ├── mass.h │ ├── rope.cpp │ ├── rope.h │ └── spring.h ├── .gitignore ├── 7.5(only note) └── readme.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | */build -------------------------------------------------------------------------------- /0/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.8.11) 2 | project (Transformation) 3 | 4 | find_package(Eigen3 REQUIRED) 5 | include_directories(EIGEN3_INCLUDE_DIR) 6 | 7 | add_executable (Transformation main.cpp) 8 | -------------------------------------------------------------------------------- /0/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(){ 7 | 8 | // Basic Example of cpp 9 | std::cout << "Example of cpp \n"; 10 | float a = 1.0, b = 2.0; 11 | std::cout << a << std::endl; 12 | std::cout << a/b << std::endl; 13 | std::cout << std::sqrt(b) << std::endl; 14 | std::cout << std::acos(-1) << std::endl; 15 | std::cout << std::sin(30.0/180.0*acos(-1)) << std::endl; 16 | 17 | // Example of vector 18 | std::cout << "Example of vector \n"; 19 | // vector definition 20 | Eigen::Vector3f v(1.0f,2.0f,3.0f); 21 | Eigen::Vector3f w(1.0f,0.0f,0.0f); 22 | // vector output 23 | std::cout << "Example of output \n"; 24 | std::cout << v << std::endl; 25 | // vector add 26 | std::cout << "Example of add \n"; 27 | std::cout << v + w << std::endl; 28 | // vector scalar multiply 29 | std::cout << "Example of scalar multiply \n"; 30 | std::cout << v * 3.0f << std::endl; 31 | std::cout << 2.0f * v << std::endl; 32 | 33 | // Example of matrix 34 | std::cout << "Example of matrix \n"; 35 | // matrix definition 36 | Eigen::Matrix3f i,j; 37 | i << 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0; 38 | j << 2.0, 3.0, 1.0, 4.0, 6.0, 5.0, 9.0, 7.0, 8.0; 39 | // matrix output 40 | std::cout << "Example of output \n"; 41 | std::cout << i << std::endl; 42 | std::cout << i*j << std::endl; 43 | // matrix add i + j 44 | // matrix scalar multiply i * 2.0 45 | // matrix multiply i * j 46 | // matrix multiply vector i * v 47 | 48 | return 0; 49 | } -------------------------------------------------------------------------------- /1/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(Rasterizer) 3 | 4 | find_package(OpenCV REQUIRED) 5 | 6 | set(CMAKE_CXX_STANDARD 17) 7 | 8 | include_directories(/usr/local/include) 9 | 10 | add_executable(Rasterizer main.cpp rasterizer.hpp rasterizer.cpp Triangle.hpp Triangle.cpp) 11 | target_link_libraries(Rasterizer ${OpenCV_LIBRARIES}) 12 | -------------------------------------------------------------------------------- /1/Triangle.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/11/19. 3 | // 4 | 5 | #include "Triangle.hpp" 6 | #include 7 | #include 8 | #include 9 | 10 | Triangle::Triangle() 11 | { 12 | v[0] << 0, 0, 0; 13 | v[1] << 0, 0, 0; 14 | v[2] << 0, 0, 0; 15 | 16 | color[0] << 0.0, 0.0, 0.0; 17 | color[1] << 0.0, 0.0, 0.0; 18 | color[2] << 0.0, 0.0, 0.0; 19 | 20 | tex_coords[0] << 0.0, 0.0; 21 | tex_coords[1] << 0.0, 0.0; 22 | tex_coords[2] << 0.0, 0.0; 23 | } 24 | 25 | void Triangle::setVertex(int ind, Eigen::Vector3f ver) { v[ind] = ver; } 26 | 27 | void Triangle::setNormal(int ind, Vector3f n) { normal[ind] = n; } 28 | 29 | void Triangle::setColor(int ind, float r, float g, float b) 30 | { 31 | if ((r < 0.0) || (r > 255.) || (g < 0.0) || (g > 255.) || (b < 0.0) || 32 | (b > 255.)) { 33 | throw std::runtime_error("Invalid color values"); 34 | } 35 | 36 | color[ind] = Vector3f((float)r / 255., (float)g / 255., (float)b / 255.); 37 | return; 38 | } 39 | void Triangle::setTexCoord(int ind, float s, float t) 40 | { 41 | tex_coords[ind] = Vector2f(s, t); 42 | } 43 | 44 | std::array Triangle::toVector4() const 45 | { 46 | std::array res; 47 | std::transform(std::begin(v), std::end(v), res.begin(), [](auto& vec) { 48 | return Vector4f(vec.x(), vec.y(), vec.z(), 1.f); 49 | }); 50 | return res; 51 | } 52 | -------------------------------------------------------------------------------- /1/Triangle.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/11/19. 3 | // 4 | 5 | #ifndef RASTERIZER_TRIANGLE_H 6 | #define RASTERIZER_TRIANGLE_H 7 | 8 | #include 9 | 10 | using namespace Eigen; 11 | class Triangle 12 | { 13 | public: 14 | Vector3f v[3]; /*the original coordinates of the triangle, v0, v1, v2 in 15 | counter clockwise order*/ 16 | /*Per vertex values*/ 17 | Vector3f color[3]; // color at each vertex; 18 | Vector2f tex_coords[3]; // texture u,v 19 | Vector3f normal[3]; // normal vector for each vertex 20 | 21 | // Texture *tex; 22 | Triangle(); 23 | 24 | Eigen::Vector3f a() const { return v[0]; } 25 | Eigen::Vector3f b() const { return v[1]; } 26 | Eigen::Vector3f c() const { return v[2]; } 27 | 28 | void setVertex(int ind, Vector3f ver); /*set i-th vertex coordinates */ 29 | void setNormal(int ind, Vector3f n); /*set i-th vertex normal vector*/ 30 | void setColor(int ind, float r, float g, float b); /*set i-th vertex color*/ 31 | void setTexCoord(int ind, float s, 32 | float t); /*set i-th vertex texture coordinate*/ 33 | std::array toVector4() const; 34 | }; 35 | 36 | #endif // RASTERIZER_TRIANGLE_H 37 | -------------------------------------------------------------------------------- /1/readme.md: -------------------------------------------------------------------------------- 1 | # Assignment 1 2 | 3 | ## Task: 4 | 5 | 1. **[MUST]** Given three 3D points, fill transformation matrices and then make points show on screen. 6 | 2. **[OPTIONAL]** Rotate points around any axis through origin. 7 | 8 | **Key words**: Transformation, rasterization. 9 | 10 | PPT: 3-5. 11 | 12 | ## Recall: 13 | 14 | 1. MVP transformation: Model, view, projection. 15 | 2. Derivation of rotation formula: use (r, theta). 16 | 3. View: 17 | 1. Camera on origin, look at -Z. 18 | 2. Rotate around any axis. Rodrigues’ Rotation Formula. 19 | 4. Projection: orthographic(正交) projection, perspective(透视) projection. 20 | 1. Orthographic projection: make all points in [-1,1]^3. 21 | 2. Perspective projection: covert to orthographic projection. 22 | 1. Near plane point's coordinate don't change, as do those on far plane. 23 | 5. Field-of-view: angle. Aspect ratio: width/height. 24 | 25 | -------------------------------------------------------------------------------- /2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(Rasterizer) 3 | 4 | find_package(OpenCV REQUIRED) 5 | 6 | set(CMAKE_CXX_STANDARD 17) 7 | 8 | include_directories(/usr/local/include) 9 | 10 | add_executable(Rasterizer main.cpp rasterizer.hpp rasterizer.cpp global.hpp Triangle.hpp Triangle.cpp) 11 | target_link_libraries(Rasterizer ${OpenCV_LIBRARIES}) 12 | -------------------------------------------------------------------------------- /2/Triangle.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/11/19. 3 | // 4 | 5 | #include "Triangle.hpp" 6 | #include 7 | #include 8 | 9 | 10 | Triangle::Triangle() { 11 | v[0] << 0,0,0; 12 | v[1] << 0,0,0; 13 | v[2] << 0,0,0; 14 | 15 | color[0] << 0.0, 0.0, 0.0; 16 | color[1] << 0.0, 0.0, 0.0; 17 | color[2] << 0.0, 0.0, 0.0; 18 | 19 | tex_coords[0] << 0.0, 0.0; 20 | tex_coords[1] << 0.0, 0.0; 21 | tex_coords[2] << 0.0, 0.0; 22 | } 23 | 24 | void Triangle::setVertex(int ind, Vector3f ver){ 25 | v[ind] = ver; 26 | } 27 | void Triangle::setNormal(int ind, Vector3f n){ 28 | normal[ind] = n; 29 | } 30 | void Triangle::setColor(int ind, float r, float g, float b) { 31 | if((r<0.0) || (r>255.) || 32 | (g<0.0) || (g>255.) || 33 | (b<0.0) || (b>255.)) { 34 | fprintf(stderr, "ERROR! Invalid color values"); 35 | fflush(stderr); 36 | exit(-1); 37 | } 38 | 39 | color[ind] = Vector3f((float)r/255.,(float)g/255.,(float)b/255.); 40 | return; 41 | } 42 | void Triangle::setTexCoord(int ind, float s, float t) { 43 | tex_coords[ind] = Vector2f(s,t); 44 | } 45 | 46 | std::array Triangle::toVector4() const 47 | { 48 | std::array res; 49 | std::transform(std::begin(v), std::end(v), res.begin(), [](auto& vec) { return Eigen::Vector4f(vec.x(), vec.y(), vec.z(), 1.f); }); 50 | return res; 51 | } 52 | -------------------------------------------------------------------------------- /2/Triangle.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/11/19. 3 | // 4 | 5 | #ifndef RASTERIZER_TRIANGLE_H 6 | #define RASTERIZER_TRIANGLE_H 7 | 8 | #include 9 | 10 | 11 | using namespace Eigen; 12 | class Triangle{ 13 | 14 | public: 15 | Vector3f v[3]; /*the original coordinates of the triangle, v0, v1, v2 in counter clockwise order*/ 16 | /*Per vertex values*/ 17 | Vector3f color[3]; //color at each vertex; 18 | Vector2f tex_coords[3]; //texture u,v 19 | Vector3f normal[3]; //normal vector for each vertex 20 | 21 | //Texture *tex; 22 | Triangle(); 23 | 24 | void setVertex(int ind, Vector3f ver); /*set i-th vertex coordinates */ 25 | void setNormal(int ind, Vector3f n); /*set i-th vertex normal vector*/ 26 | void setColor(int ind, float r, float g, float b); /*set i-th vertex color*/ 27 | Vector3f getColor() const { return color[0]*255; } // Only one color per triangle. 28 | void setTexCoord(int ind, float s, float t); /*set i-th vertex texture coordinate*/ 29 | std::array toVector4() const; 30 | }; 31 | 32 | 33 | 34 | 35 | 36 | 37 | #endif //RASTERIZER_TRIANGLE_H 38 | -------------------------------------------------------------------------------- /2/global.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/9/19. 3 | // 4 | 5 | #ifndef RASTERIZER_GLOBAL_H 6 | #define RASTERIZER_GLOBAL_H 7 | 8 | //#define MY_PI 3.1415926 9 | //#define TWO_PI (2.0* MY_PI) 10 | 11 | 12 | #endif //RASTERIZER_GLOBAL_H 13 | -------------------------------------------------------------------------------- /2/md_image/SSAA2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/2/md_image/SSAA2.png -------------------------------------------------------------------------------- /2/md_image/SSAA3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/2/md_image/SSAA3.png -------------------------------------------------------------------------------- /2/md_image/naive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/2/md_image/naive.png -------------------------------------------------------------------------------- /2/readme.md: -------------------------------------------------------------------------------- 1 | # Assignment 2 2 | 3 | ## Task: 4 | 5 | Implement Z-buffer and super-sampling anti-aliasing(SSAA). 6 | 7 | **Key words**: Sampling. 8 | 9 | PPT: 5-7 10 | 11 | ## Recall: 12 | 13 | 1. Antialiasing. Blurring(pre-filtering) before sampling. 14 | 1. Filtering(=Averaging): Getting rid of certain frequency contents. 15 | 2. Sampling: Repeating frequency contents. 16 | 3. Antialiasing = Limiting then repeating. 17 | 2. Antialiasing by super-sampling. 18 | 1. MSAA(Multi-Sampling Anti-Aliasing): Sampling multiple locations pre pixel, then averaging. 19 | 2. Today: FXAA, TAA, DLSS. 20 | 3. Z-buffer. Saving depth. 21 | 22 | ## Code: 23 | 24 | Adaptive any N, change it in **rasterizer.hpp** line 102. 25 | 26 | Z-buffer: 27 | 28 | ![image](https://github.com/DQSSSSS/GAMES101_Assignment/blob/master/2/md_image/naive.png?raw=true) 29 | 30 | SSAA: 31 | 32 | N=2 33 | 34 | ![img](https://github.com/DQSSSSS/GAMES101_Assignment/blob/master/2/md_image/SSAA2.png?raw=true) 35 | 36 | N=3 37 | 38 | ![img](https://github.com/DQSSSSS/GAMES101_Assignment/blob/master/2/md_image/SSAA3.png?raw=true) 39 | -------------------------------------------------------------------------------- /3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(Rasterizer) 3 | 4 | find_package(OpenCV REQUIRED) 5 | 6 | set(CMAKE_CXX_STANDARD 17) 7 | 8 | include_directories(/usr/local/include ./include) 9 | 10 | add_executable(Rasterizer main.cpp rasterizer.hpp rasterizer.cpp global.hpp Triangle.hpp Triangle.cpp Texture.hpp Texture.cpp Shader.hpp OBJ_Loader.h) 11 | target_link_libraries(Rasterizer ${OpenCV_LIBRARIES}) 12 | #target_compile_options(Rasterizer PUBLIC -Wall -Wextra -pedantic) -------------------------------------------------------------------------------- /3/Shader.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/27/19. 3 | // 4 | 5 | #ifndef RASTERIZER_SHADER_H 6 | #define RASTERIZER_SHADER_H 7 | #include 8 | #include "Texture.hpp" 9 | 10 | 11 | struct fragment_shader_payload 12 | { 13 | fragment_shader_payload() 14 | { 15 | texture = nullptr; 16 | } 17 | 18 | fragment_shader_payload(const Eigen::Vector3f& col, const Eigen::Vector3f& nor,const Eigen::Vector2f& tc, Texture* tex) : 19 | color(col), normal(nor), tex_coords(tc), texture(tex) {} 20 | 21 | 22 | Eigen::Vector3f view_pos; 23 | Eigen::Vector3f color; 24 | Eigen::Vector3f normal; 25 | Eigen::Vector2f tex_coords; 26 | Texture* texture; 27 | }; 28 | 29 | struct vertex_shader_payload 30 | { 31 | Eigen::Vector3f position; 32 | }; 33 | 34 | #endif //RASTERIZER_SHADER_H 35 | -------------------------------------------------------------------------------- /3/Texture.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/27/19. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /3/Texture.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/27/19. 3 | // 4 | 5 | #ifndef RASTERIZER_TEXTURE_H 6 | #define RASTERIZER_TEXTURE_H 7 | #include "global.hpp" 8 | #include 9 | #include 10 | class Texture{ 11 | private: 12 | cv::Mat image_data; 13 | 14 | public: 15 | Texture(const std::string& name) 16 | { 17 | image_data = cv::imread(name); 18 | cv::cvtColor(image_data, image_data, cv::COLOR_RGB2BGR); 19 | width = image_data.cols; 20 | height = image_data.rows; 21 | } 22 | 23 | int width, height; 24 | 25 | Eigen::Vector3f getColor(float u, float v) 26 | { 27 | return getColorBilinear(u, v); 28 | 29 | auto u_img = u * width; 30 | auto v_img = (1 - v) * height; 31 | auto color = image_data.at(v_img, u_img); 32 | return Eigen::Vector3f(color[0], color[1], color[2]); 33 | } 34 | 35 | Eigen::Vector3f getColorBilinear(float u, float v) { 36 | float y = u * width; 37 | float x = (1 - v) * height; 38 | 39 | int x0 = x, x1 = x + 1; 40 | int y0 = y, y1 = y + 1; 41 | 42 | auto get = [&](cv::Vec3b color) { 43 | return Eigen::Vector3f(color[0], color[1], color[2]); 44 | }; 45 | 46 | auto c00 = get(image_data.at(x0, y0)); 47 | auto c01 = get(image_data.at(x0, y1)); 48 | auto c10 = get(image_data.at(x1, y0)); 49 | auto c11 = get(image_data.at(x1, y1)); 50 | 51 | // x \in [0,1], f(0)=y0, f(1)=y1 52 | auto lerp = [&](float x, Eigen::Vector3f y0, Eigen::Vector3f y1) { 53 | return y0 + x*(y1-y0); 54 | }; 55 | 56 | auto s0 = lerp(y-y0, c00, c01); 57 | auto s1 = lerp(y-y0, c10, c11); 58 | return lerp(x-x0, s0, s1); 59 | } 60 | 61 | }; 62 | #endif //RASTERIZER_TEXTURE_H 63 | -------------------------------------------------------------------------------- /3/Triangle.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/11/19. 3 | // 4 | 5 | #include "Triangle.hpp" 6 | #include 7 | #include 8 | 9 | Triangle::Triangle() { 10 | v[0] << 0,0,0,1; 11 | v[1] << 0,0,0,1; 12 | v[2] << 0,0,0,1; 13 | 14 | color[0] << 0.0, 0.0, 0.0; 15 | color[1] << 0.0, 0.0, 0.0; 16 | color[2] << 0.0, 0.0, 0.0; 17 | 18 | tex_coords[0] << 0.0, 0.0; 19 | tex_coords[1] << 0.0, 0.0; 20 | tex_coords[2] << 0.0, 0.0; 21 | } 22 | 23 | void Triangle::setVertex(int ind, Vector4f ver){ 24 | v[ind] = ver; 25 | } 26 | void Triangle::setNormal(int ind, Vector3f n){ 27 | normal[ind] = n; 28 | } 29 | void Triangle::setColor(int ind, float r, float g, float b) { 30 | if((r<0.0) || (r>255.) || 31 | (g<0.0) || (g>255.) || 32 | (b<0.0) || (b>255.)) { 33 | fprintf(stderr, "ERROR! Invalid color values"); 34 | fflush(stderr); 35 | exit(-1); 36 | } 37 | 38 | color[ind] = Vector3f((float)r/255.,(float)g/255.,(float)b/255.); 39 | return; 40 | } 41 | void Triangle::setTexCoord(int ind, Vector2f uv) { 42 | tex_coords[ind] = uv; 43 | } 44 | 45 | std::array Triangle::toVector4() const 46 | { 47 | std::array res; 48 | std::transform(std::begin(v), std::end(v), res.begin(), [](auto& vec) { return Vector4f(vec.x(), vec.y(), vec.z(), 1.f); }); 49 | return res; 50 | } 51 | 52 | void Triangle::setNormals(const std::array& normals) 53 | { 54 | normal[0] = normals[0]; 55 | normal[1] = normals[1]; 56 | normal[2] = normals[2]; 57 | } 58 | 59 | void Triangle::setColors(const std::array& colors) 60 | { 61 | auto first_color = colors[0]; 62 | setColor(0, colors[0][0], colors[0][1], colors[0][2]); 63 | setColor(1, colors[1][0], colors[1][1], colors[1][2]); 64 | setColor(2, colors[2][0], colors[2][1], colors[2][2]); 65 | } -------------------------------------------------------------------------------- /3/Triangle.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/11/19. 3 | // 4 | 5 | #ifndef RASTERIZER_TRIANGLE_H 6 | #define RASTERIZER_TRIANGLE_H 7 | 8 | #include 9 | #include "Texture.hpp" 10 | 11 | using namespace Eigen; 12 | class Triangle{ 13 | 14 | public: 15 | Vector4f v[3]; /*the original coordinates of the triangle, v0, v1, v2 in counter clockwise order*/ 16 | /*Per vertex values*/ 17 | Vector3f color[3]; //color at each vertex; 18 | Vector2f tex_coords[3]; //texture u,v 19 | Vector3f normal[3]; //normal vector for each vertex 20 | 21 | Texture *tex= nullptr; 22 | Triangle(); 23 | 24 | Eigen::Vector4f a() const { return v[0]; } 25 | Eigen::Vector4f b() const { return v[1]; } 26 | Eigen::Vector4f c() const { return v[2]; } 27 | 28 | void setVertex(int ind, Vector4f ver); /*set i-th vertex coordinates */ 29 | void setNormal(int ind, Vector3f n); /*set i-th vertex normal vector*/ 30 | void setColor(int ind, float r, float g, float b); /*set i-th vertex color*/ 31 | 32 | void setNormals(const std::array& normals); 33 | void setColors(const std::array& colors); 34 | void setTexCoord(int ind,Vector2f uv ); /*set i-th vertex texture coordinate*/ 35 | std::array toVector4() const; 36 | }; 37 | 38 | 39 | 40 | 41 | 42 | 43 | #endif //RASTERIZER_TRIANGLE_H 44 | -------------------------------------------------------------------------------- /3/global.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 4/9/19. 3 | // 4 | 5 | #ifndef RASTERIZER_GLOBAL_H 6 | #define RASTERIZER_GLOBAL_H 7 | 8 | typedef unsigned char u08; 9 | #define MY_PI 3.1415926 10 | #define TWO_PI (2.0* MY_PI) 11 | 12 | 13 | 14 | #endif //RASTERIZER_GLOBAL_H 15 | -------------------------------------------------------------------------------- /3/images/crate/bump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/crate/bump.png -------------------------------------------------------------------------------- /3/images/crate/displacement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/crate/displacement.png -------------------------------------------------------------------------------- /3/images/crate/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/crate/normal.png -------------------------------------------------------------------------------- /3/images/crate/phong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/crate/phong.png -------------------------------------------------------------------------------- /3/images/crate/texture1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/crate/texture1.png -------------------------------------------------------------------------------- /3/images/crate/texture2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/crate/texture2.png -------------------------------------------------------------------------------- /3/images/cube/bump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/cube/bump.png -------------------------------------------------------------------------------- /3/images/cube/displacement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/cube/displacement.png -------------------------------------------------------------------------------- /3/images/cube/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/cube/normal.png -------------------------------------------------------------------------------- /3/images/cube/phong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/cube/phong.png -------------------------------------------------------------------------------- /3/images/cube/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/cube/texture.png -------------------------------------------------------------------------------- /3/images/cube/texture1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/cube/texture1.png -------------------------------------------------------------------------------- /3/images/spot/bump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/spot/bump.png -------------------------------------------------------------------------------- /3/images/spot/displacement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/spot/displacement.png -------------------------------------------------------------------------------- /3/images/spot/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/spot/normal.png -------------------------------------------------------------------------------- /3/images/spot/phong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/spot/phong.png -------------------------------------------------------------------------------- /3/images/spot/texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/spot/texture.png -------------------------------------------------------------------------------- /3/images/texture-2itplt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/texture-2itplt.png -------------------------------------------------------------------------------- /3/images/texture-noitplt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/images/texture-noitplt.png -------------------------------------------------------------------------------- /3/models/Crate/Crate1.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/Crate/Crate1.3ds -------------------------------------------------------------------------------- /3/models/Crate/Crate1.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/Crate/Crate1.blend -------------------------------------------------------------------------------- /3/models/Crate/Crate1.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'Crate1.blend' 2 | # Material Count: 1 3 | 4 | newmtl Material.001 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | map_Kd C:\\Users\\Elijah\\Pictures\\ToBeTextures\\crate_1.jpg 13 | -------------------------------------------------------------------------------- /3/models/Crate/Crate1.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.67 (sub 1) OBJ File: 'Crate1.blend' 2 | # www.blender.org 3 | mtllib Crate1.mtl 4 | o Cube_Cube.001 5 | v -1.000000 -1.000000 1.000000 6 | v -1.000000 -1.000000 -1.000000 7 | v 1.000000 -1.000000 -1.000000 8 | v 1.000000 -1.000000 1.000000 9 | v -1.000000 1.000000 1.000000 10 | v -1.000000 1.000000 -1.000000 11 | v 1.000000 1.000000 -1.000000 12 | v 1.000000 1.000000 1.000000 13 | vt 0.000000 0.000000 14 | vt 1.000000 0.000000 15 | vt 1.000000 1.000000 16 | vt 0.000000 1.000000 17 | usemtl Material.001 18 | f 5/1 6/2 2/3 1/4 19 | f 6/1 7/2 3/3 2/4 20 | f 7/1 8/2 4/3 3/4 21 | f 8/1 5/2 1/3 4/4 22 | f 1/1 2/2 3/3 4/4 23 | f 8/1 7/2 6/3 5/4 24 | -------------------------------------------------------------------------------- /3/models/Crate/CrateImage1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/Crate/CrateImage1.JPG -------------------------------------------------------------------------------- /3/models/Crate/CrateImage2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/Crate/CrateImage2.JPG -------------------------------------------------------------------------------- /3/models/Crate/crate_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/Crate/crate_1.jpg -------------------------------------------------------------------------------- /3/models/cube/cube.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'Crate1.blend' 2 | # Material Count: 1 3 | 4 | newmtl Material.001 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | map_Kd wall1.tif 13 | -------------------------------------------------------------------------------- /3/models/cube/cube.obj: -------------------------------------------------------------------------------- 1 | # Blender3D v249 OBJ File: untitled.blend 2 | # www.blender3d.org 3 | mtllib cube.mtl 4 | v 1.000000 -1.000000 -1.000000 5 | v 1.000000 -1.000000 1.000000 6 | v -1.000000 -1.000000 1.000000 7 | v -1.000000 -1.000000 -1.000000 8 | v 1.000000 1.000000 -1.000000 9 | v 0.999999 1.000000 1.000001 10 | v -1.000000 1.000000 1.000000 11 | v -1.000000 1.000000 -1.000000 12 | vt 0.748573 0.750412 13 | vt 0.749279 0.501284 14 | vt 0.999110 0.501077 15 | vt 0.999455 0.750380 16 | vt 0.250471 0.500702 17 | vt 0.249682 0.749677 18 | vt 0.001085 0.750380 19 | vt 0.001517 0.499994 20 | vt 0.499422 0.500239 21 | vt 0.500149 0.750166 22 | vt 0.748355 0.998230 23 | vt 0.500193 0.998728 24 | vt 0.498993 0.250415 25 | vt 0.748953 0.250920 26 | vn 0.000000 0.000000 -1.000000 27 | vn -1.000000 -0.000000 -0.000000 28 | vn -0.000000 -0.000000 1.000000 29 | vn -0.000001 0.000000 1.000000 30 | vn 1.000000 -0.000000 0.000000 31 | vn 1.000000 0.000000 0.000001 32 | vn 0.000000 1.000000 -0.000000 33 | vn -0.000000 -1.000000 0.000000 34 | s off 35 | f 5/1/1 1/2/1 4/3/1 36 | f 5/1/1 4/3/1 8/4/1 37 | f 3/5/2 7/6/2 8/7/2 38 | f 3/5/2 8/7/2 4/8/2 39 | f 2/9/3 6/10/3 3/5/3 40 | f 6/10/4 7/6/4 3/5/4 41 | f 1/2/5 5/1/5 2/9/5 42 | f 5/1/6 6/10/6 2/9/6 43 | f 5/1/7 8/11/7 6/10/7 44 | f 8/11/7 7/12/7 6/10/7 45 | f 1/2/8 2/9/8 3/13/8 46 | f 1/2/8 3/13/8 4/14/8 -------------------------------------------------------------------------------- /3/models/cube/wall.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/cube/wall.tif -------------------------------------------------------------------------------- /3/models/cube/wall1.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/cube/wall1.tif -------------------------------------------------------------------------------- /3/models/rock/rock.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'Rock1.blend' 2 | # Material Count: 1 3 | 4 | newmtl Material 5 | Ns 13.725490 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.007937 0.007937 0.007937 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | map_Kd rock.png 13 | map_Bump rock.png 14 | -------------------------------------------------------------------------------- /3/models/rock/rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/rock/rock.png -------------------------------------------------------------------------------- /3/models/spot/README.txt: -------------------------------------------------------------------------------- 1 | Spot 2 | ==== 3 | contact: Keenan Crane (keenan@cs.caltech.edu) 4 | 5 | Files 6 | -------------------------------------------- 7 | This archive contains a description of the surface "Spot," including: 8 | 9 | 1. the original Catmull-Clark control mesh [spot_control_mesh.obj] 10 | 2. the original texture map as a vector image [spot_texture.svg] 11 | 3. triangular and quadrilateral tessellations [spot_triangulated.obj, spot_quadrangulated.obj] 12 | 4. the texture map as a raster image [spot_texture.png] 13 | 14 | Note that (3) and (4) can be generated from (1) and (2), and are provided only 15 | for convenience. Meshes are stored in the Wavefront OBJ format. All meshes 16 | are manifold, genus-0 embeddings. The texture map should be interpreted as a 17 | unit square in the positive quadrant [0,1]x[0,1]. 18 | 19 | License 20 | -------------------------------------------- 21 | 22 | As the sole author of this data, I hereby release it into the public domain. 23 | 24 | -------------------------------------------------------------------------------- /3/models/spot/hmap.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/spot/hmap.jpg -------------------------------------------------------------------------------- /3/models/spot/spot_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/3/models/spot/spot_texture.png -------------------------------------------------------------------------------- /4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(BezierCurve) 3 | 4 | find_package(OpenCV REQUIRED) 5 | 6 | set(CMAKE_CXX_STANDARD 14) 7 | 8 | add_executable(BezierCurve main.cpp) 9 | 10 | target_link_libraries(BezierCurve ${OpenCV_LIBRARIES}) 11 | -------------------------------------------------------------------------------- /4/readme.md: -------------------------------------------------------------------------------- 1 | # Assignment 4 2 | 3 | ## Task: 4 | 5 | De Casteljau Algorithm. 6 | 7 | **Key words**: Geometry 8 | 9 | PPT: 10-12 10 | 11 | ## Recall: 12 | 13 | 1. Represent. 14 | 1. Implicit. For example: f(x,y,z)=... 15 | 1. Constructive: Boolean operations. 16 | 2. Signed distance functions. Gradually blend surface together. [Wiki](https://en.wikipedia.org/wiki/Signed_distance_function). 17 | 2. Explicit. Point cloud, polygon mesh ... Curve and surface. 18 | 2. Curves. Bezier Curves. De Casteljau Algorithm. 19 | 1. Quadratic: Let's $t \in [0, 1]$ , choose point S on AB that |SA|=t|AB|, choose point T on BC that |TB|=t|BC|, then choose point P on ST that |PS|=t|ST|. 20 | 2. Cubic: Four input points. 21 | 3. Let's $b_i^t$ is i-th point in t-th layer(both t, i's index from 0). $b_0^n$ is component by $b_i^0$ with Bernstein polynomials with unknown number t. 22 | 4. Properties: 23 | 1. Interpolates endpoints. $b(0)=b_0^0, b(1) = b_n^0$ . 24 | 2. Tangent tp end segments. 25 | 3. Affine transformation. 26 | 4. Curve is within convex hull of control points. 27 | 5. Piecewise Bezier Curves. Continuity. 28 | 3. Surfaces. 29 | 1. Bezier surfaces. 1-D's extension. 30 | 2. Mesh operations. 31 | 1. Mesh subdivision. Create then tune. 32 | 1. Catmull-Clark Subdivision. 33 | 2. Mesh simplification. Edge collapsing. New vertex should minimize its sum of L2 distance. 34 | 3. Mesh regularization. 35 | 4. Shadow mapping. 36 | 1. Key idea: the points not in shadow mush be seen with both by the light and by the camera. 37 | 2. Get depth image from light, then render from eye. 38 | 3. Problems 39 | 1. Hard shadows(point lights only) 40 | 2. Quality depends on shadow map resolution. 41 | 3. Equality comparison between float number. 42 | 43 | ## Code: 44 | 45 | Antialiasing, two methods: 46 | 47 | 1. $\sum_i 255 \times \max(2-\exp(dist_i), 0)$ 48 | 2. For 2*2 grids, $f_{i,j} = 255\times(\lfloor x+1-i\rfloor-x)(\lfloor y+1-j\rfloor-y)$ for each $i = 0,1,j = 0,1$ . 49 | 50 | -------------------------------------------------------------------------------- /5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(RayTracing) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | 6 | add_executable(RayTracing main.cpp Object.hpp Vector.hpp Sphere.hpp global.hpp Triangle.hpp Scene.cpp Scene.hpp Light.hpp Renderer.cpp) 7 | target_compile_options(RayTracing PUBLIC -Wall -Wextra -pedantic -Wshadow -Wreturn-type -fsanitize=undefined) 8 | target_compile_features(RayTracing PUBLIC cxx_std_17) 9 | target_link_libraries(RayTracing PUBLIC -fsanitize=undefined) 10 | -------------------------------------------------------------------------------- /5/Light.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Vector.hpp" 4 | 5 | class Light 6 | { 7 | public: 8 | Light(const Vector3f& p, const Vector3f& i) 9 | : position(p) 10 | , intensity(i) 11 | {} 12 | virtual ~Light() = default; 13 | Vector3f position; 14 | Vector3f intensity; 15 | }; 16 | -------------------------------------------------------------------------------- /5/Object.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Vector.hpp" 4 | #include "global.hpp" 5 | 6 | class Object 7 | { 8 | public: 9 | Object() 10 | : materialType(DIFFUSE_AND_GLOSSY) 11 | , ior(1.3) 12 | , Kd(0.8) 13 | , Ks(0.2) 14 | , diffuseColor(0.2) 15 | , specularExponent(25) 16 | {} 17 | 18 | virtual ~Object() = default; 19 | 20 | virtual bool intersect(const Vector3f&, const Vector3f&, float&, uint32_t&, Vector2f&) const = 0; 21 | 22 | virtual void getSurfaceProperties(const Vector3f&, const Vector3f&, const uint32_t&, const Vector2f&, Vector3f&, 23 | Vector2f&) const = 0; 24 | 25 | virtual Vector3f evalDiffuseColor(const Vector2f&) const 26 | { 27 | return diffuseColor; 28 | } 29 | 30 | // material properties 31 | MaterialType materialType; 32 | float ior; 33 | float Kd, Ks; 34 | Vector3f diffuseColor; 35 | float specularExponent; 36 | }; 37 | -------------------------------------------------------------------------------- /5/Renderer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Scene.hpp" 3 | 4 | struct hit_payload 5 | { 6 | float tNear; 7 | uint32_t index; 8 | Vector2f uv; 9 | Object* hit_obj; 10 | }; 11 | 12 | class Renderer 13 | { 14 | public: 15 | void Render(const Scene& scene); 16 | 17 | private: 18 | }; -------------------------------------------------------------------------------- /5/Scene.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Göksu Güvendiren on 2019-05-14. 3 | // 4 | 5 | #include "Scene.hpp" 6 | -------------------------------------------------------------------------------- /5/Scene.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "Vector.hpp" 6 | #include "Object.hpp" 7 | #include "Light.hpp" 8 | 9 | class Scene 10 | { 11 | public: 12 | // setting up options 13 | int width = 1280; 14 | int height = 960; 15 | double fov = 90; 16 | Vector3f backgroundColor = Vector3f(0.235294, 0.67451, 0.843137); 17 | int maxDepth = 5; 18 | float epsilon = 0.00001; 19 | 20 | Scene(int w, int h) : width(w), height(h) 21 | {} 22 | 23 | void Add(std::unique_ptr object) { objects.push_back(std::move(object)); } 24 | void Add(std::unique_ptr light) { lights.push_back(std::move(light)); } 25 | 26 | [[nodiscard]] const std::vector >& get_objects() const { return objects; } 27 | [[nodiscard]] const std::vector >& get_lights() const { return lights; } 28 | 29 | private: 30 | // creating the scene (adding objects and lights) 31 | std::vector > objects; 32 | std::vector > lights; 33 | }; -------------------------------------------------------------------------------- /5/Sphere.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Object.hpp" 4 | #include "Vector.hpp" 5 | 6 | class Sphere : public Object 7 | { 8 | public: 9 | Sphere(const Vector3f& c, const float& r) 10 | : center(c) 11 | , radius(r) 12 | , radius2(r * r) 13 | {} 14 | 15 | bool intersect(const Vector3f& orig, const Vector3f& dir, float& tnear, uint32_t&, Vector2f&) const override 16 | { 17 | // analytic solution 18 | Vector3f L = orig - center; 19 | float a = dotProduct(dir, dir); 20 | float b = 2 * dotProduct(dir, L); 21 | float c = dotProduct(L, L) - radius2; 22 | float t0, t1; 23 | if (!solveQuadratic(a, b, c, t0, t1)) 24 | return false; 25 | if (t0 < 0) 26 | t0 = t1; 27 | if (t0 < 0) 28 | return false; 29 | tnear = t0; 30 | 31 | return true; 32 | } 33 | 34 | void getSurfaceProperties(const Vector3f& P, const Vector3f&, const uint32_t&, const Vector2f&, 35 | Vector3f& N, Vector2f&) const override 36 | { 37 | N = normalize(P - center); 38 | } 39 | 40 | Vector3f center; 41 | float radius, radius2; 42 | }; 43 | -------------------------------------------------------------------------------- /5/global.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #define M_PI 3.14159265358979323846 8 | 9 | constexpr float kInfinity = std::numeric_limits::max(); 10 | 11 | inline float clamp(const float& lo, const float& hi, const float& v) 12 | { 13 | return std::max(lo, std::min(hi, v)); 14 | } 15 | 16 | inline bool solveQuadratic(const float& a, const float& b, const float& c, float& x0, float& x1) 17 | { 18 | float discr = b * b - 4 * a * c; 19 | if (discr < 0) 20 | return false; 21 | else if (discr == 0) 22 | x0 = x1 = -0.5 * b / a; 23 | else 24 | { 25 | float q = (b > 0) ? -0.5 * (b + sqrt(discr)) : -0.5 * (b - sqrt(discr)); 26 | x0 = q / a; 27 | x1 = c / q; 28 | } 29 | if (x0 > x1) 30 | std::swap(x0, x1); 31 | return true; 32 | } 33 | 34 | enum MaterialType 35 | { 36 | DIFFUSE_AND_GLOSSY, 37 | REFLECTION_AND_REFRACTION, 38 | REFLECTION 39 | }; 40 | 41 | inline float get_random_float() 42 | { 43 | std::random_device dev; 44 | std::mt19937 rng(dev()); 45 | std::uniform_real_distribution dist(0.f, 1.f); // distribution in range [1, 6] 46 | 47 | return dist(rng); 48 | } 49 | 50 | inline void UpdateProgress(float progress) 51 | { 52 | int barWidth = 70; 53 | 54 | std::cout << "["; 55 | int pos = barWidth * progress; 56 | for (int i = 0; i < barWidth; ++i) 57 | { 58 | if (i < pos) 59 | std::cout << "="; 60 | else if (i == pos) 61 | std::cout << ">"; 62 | else 63 | std::cout << " "; 64 | } 65 | std::cout << "] " << int(progress * 100.0) << " %\r"; 66 | std::cout.flush(); 67 | } 68 | -------------------------------------------------------------------------------- /5/images/binary.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/5/images/binary.ppm -------------------------------------------------------------------------------- /5/main.cpp: -------------------------------------------------------------------------------- 1 | #include "Scene.hpp" 2 | #include "Sphere.hpp" 3 | #include "Triangle.hpp" 4 | #include "Light.hpp" 5 | #include "Renderer.hpp" 6 | 7 | // In the main function of the program, we create the scene (create objects and lights) 8 | // as well as set the options for the render (image width and height, maximum recursion 9 | // depth, field-of-view, etc.). We then call the render function(). 10 | int main() 11 | { 12 | Scene scene(1280, 960); 13 | 14 | auto sph1 = std::make_unique(Vector3f(-1, 0, -12), 2); 15 | sph1->materialType = DIFFUSE_AND_GLOSSY; 16 | sph1->diffuseColor = Vector3f(0.6, 0.7, 0.8); 17 | 18 | auto sph2 = std::make_unique(Vector3f(0.5, -0.5, -8), 1.5); 19 | sph2->ior = 1.5; 20 | sph2->materialType = REFLECTION_AND_REFRACTION; 21 | 22 | scene.Add(std::move(sph1)); 23 | scene.Add(std::move(sph2)); 24 | 25 | Vector3f verts[4] = {{-5,-3,-6}, {5,-3,-6}, {5,-3,-16}, {-5,-3,-16}}; 26 | uint32_t vertIndex[6] = {0, 1, 3, 1, 2, 3}; 27 | Vector2f st[4] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}}; 28 | auto mesh = std::make_unique(verts, vertIndex, 2, st); 29 | mesh->materialType = DIFFUSE_AND_GLOSSY; 30 | 31 | scene.Add(std::move(mesh)); 32 | scene.Add(std::make_unique(Vector3f(-20, 70, 20), 0.5)); 33 | scene.Add(std::make_unique(Vector3f(30, 50, -12), 0.5)); 34 | 35 | Renderer r; 36 | r.Render(scene); 37 | 38 | return 0; 39 | } -------------------------------------------------------------------------------- /5/readme.md: -------------------------------------------------------------------------------- 1 | # Assignment 5 2 | 3 | ## Task: 4 | 5 | Implement Whitted-Style ray tracing. 6 | 7 | **Key words**: Whitted-Style ray tracing 8 | 9 | PPT: 13 10 | 11 | ## Recall: 12 | 13 | 1. Whitted-Style ray tracing. Shooting a ray from eye across pre pixel, hitting some items multiply times, linking hit points to light sources, then computing the color on this pixel. 14 | 1. Ray intersection with triangle. Check? Moller-Trumbore Algorithm(giving barycentric coordinate). 15 | 2. Accelerating. Bounding Volumes. Axis-Aligned Bounding Box(AABB). 16 | 17 | ## Code: 18 | 19 | [-1, 1] x [-1, 1] -------------------------------------------------------------------------------- /6/AreaLight.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Göksu Güvendiren on 2019-05-14. 3 | // 4 | 5 | #pragma once 6 | 7 | #include "Vector.hpp" 8 | #include "Light.hpp" 9 | #include "global.hpp" 10 | 11 | class AreaLight : public Light 12 | { 13 | public: 14 | AreaLight(const Vector3f &p, const Vector3f &i) : Light(p, i) 15 | { 16 | normal = Vector3f(0, -1, 0); 17 | u = Vector3f(1, 0, 0); 18 | v = Vector3f(0, 0, 1); 19 | length = 100; 20 | } 21 | 22 | Vector3f SamplePoint() const 23 | { 24 | auto random_u = get_random_float(); 25 | auto random_v = get_random_float(); 26 | return position + random_u * u + random_v * v; 27 | } 28 | 29 | float length; 30 | Vector3f normal; 31 | Vector3f u; 32 | Vector3f v; 33 | }; 34 | -------------------------------------------------------------------------------- /6/BVH.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 5/16/19. 3 | // 4 | 5 | #ifndef RAYTRACING_BVH_H 6 | #define RAYTRACING_BVH_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "Object.hpp" 13 | #include "Ray.hpp" 14 | #include "Bounds3.hpp" 15 | #include "Intersection.hpp" 16 | #include "Vector.hpp" 17 | 18 | struct BVHBuildNode; 19 | // BVHAccel Forward Declarations 20 | struct BVHPrimitiveInfo; 21 | 22 | // BVHAccel Declarations 23 | inline int leafNodes, totalLeafNodes, totalPrimitives, interiorNodes; 24 | class BVHAccel { 25 | 26 | public: 27 | // BVHAccel Public Types 28 | enum class SplitMethod { NAIVE, SAH }; 29 | 30 | // BVHAccel Public Methods 31 | BVHAccel(std::vector p, int maxPrimsInNode = 1, SplitMethod splitMethod = SplitMethod::SAH); 32 | Bounds3 WorldBound() const; 33 | ~BVHAccel(); 34 | 35 | Intersection Intersect(const Ray &ray) const; 36 | Intersection getIntersection(BVHBuildNode* node, const Ray& ray)const; 37 | bool IntersectP(const Ray &ray) const; 38 | BVHBuildNode* root; 39 | 40 | // BVHAccel Private Methods 41 | BVHBuildNode* recursiveBuild(std::vectorobjects); 42 | 43 | // BVHAccel Private Data 44 | const int maxPrimsInNode; 45 | const SplitMethod splitMethod; 46 | std::vector primitives; 47 | }; 48 | 49 | struct BVHBuildNode { 50 | Bounds3 bounds; 51 | BVHBuildNode *left; 52 | BVHBuildNode *right; 53 | Object* object; 54 | 55 | public: 56 | int splitAxis=0, firstPrimOffset=0, nPrimitives=0; 57 | // BVHBuildNode Public Methods 58 | BVHBuildNode(){ 59 | bounds = Bounds3(); 60 | left = nullptr;right = nullptr; 61 | object = nullptr; 62 | } 63 | }; 64 | 65 | 66 | 67 | 68 | #endif //RAYTRACING_BVH_H 69 | -------------------------------------------------------------------------------- /6/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(RayTracing) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | 6 | add_executable(RayTracing main.cpp Object.hpp Vector.cpp Vector.hpp Sphere.hpp global.hpp Triangle.hpp Scene.cpp 7 | Scene.hpp Light.hpp AreaLight.hpp BVH.cpp BVH.hpp Bounds3.hpp Ray.hpp Material.hpp Intersection.hpp 8 | Renderer.cpp Renderer.hpp) 9 | -------------------------------------------------------------------------------- /6/Intersection.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 5/16/19. 3 | // 4 | 5 | #ifndef RAYTRACING_INTERSECTION_H 6 | #define RAYTRACING_INTERSECTION_H 7 | #include "Vector.hpp" 8 | #include "Material.hpp" 9 | class Object; 10 | class Sphere; 11 | 12 | struct Intersection 13 | { 14 | Intersection(){ 15 | happened=false; 16 | coords=Vector3f(); 17 | normal=Vector3f(); 18 | distance= std::numeric_limits::max(); 19 | obj =nullptr; 20 | m=nullptr; 21 | } 22 | bool happened; 23 | Vector3f coords; 24 | Vector3f normal; 25 | double distance; 26 | Object* obj; 27 | Material* m; 28 | }; 29 | #endif //RAYTRACING_INTERSECTION_H 30 | -------------------------------------------------------------------------------- /6/Light.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Göksu Güvendiren on 2019-05-14. 3 | // 4 | 5 | #pragma once 6 | 7 | #include "Vector.hpp" 8 | 9 | class Light 10 | { 11 | public: 12 | Light(const Vector3f &p, const Vector3f &i) : position(p), intensity(i) {} 13 | virtual ~Light() = default; 14 | Vector3f position; 15 | Vector3f intensity; 16 | }; 17 | -------------------------------------------------------------------------------- /6/Material.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 5/16/19. 3 | // 4 | 5 | #ifndef RAYTRACING_MATERIAL_H 6 | #define RAYTRACING_MATERIAL_H 7 | 8 | #include "Vector.hpp" 9 | 10 | enum MaterialType { DIFFUSE_AND_GLOSSY, REFLECTION_AND_REFRACTION, REFLECTION }; 11 | 12 | class Material{ 13 | public: 14 | MaterialType m_type; 15 | Vector3f m_color; 16 | Vector3f m_emission; 17 | float ior; 18 | float Kd, Ks; 19 | float specularExponent; 20 | //Texture tex; 21 | 22 | inline Material(MaterialType t=DIFFUSE_AND_GLOSSY, Vector3f c=Vector3f(1,1,1), Vector3f e=Vector3f(0,0,0)); 23 | inline MaterialType getType(); 24 | inline Vector3f getColor(); 25 | inline Vector3f getColorAt(double u, double v); 26 | inline Vector3f getEmission(); 27 | 28 | 29 | }; 30 | 31 | Material::Material(MaterialType t, Vector3f c, Vector3f e){ 32 | m_type = t; 33 | m_color = c; 34 | m_emission = e; 35 | } 36 | 37 | MaterialType Material::getType(){return m_type;} 38 | Vector3f Material::getColor(){return m_color;} 39 | Vector3f Material::getEmission() {return m_emission;} 40 | 41 | Vector3f Material::getColorAt(double u, double v) { 42 | return Vector3f(); 43 | } 44 | #endif //RAYTRACING_MATERIAL_H 45 | -------------------------------------------------------------------------------- /6/Object.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 5/13/19. 3 | // 4 | #pragma once 5 | #ifndef RAYTRACING_OBJECT_H 6 | #define RAYTRACING_OBJECT_H 7 | 8 | #include "Vector.hpp" 9 | #include "global.hpp" 10 | #include "Bounds3.hpp" 11 | #include "Ray.hpp" 12 | #include "Intersection.hpp" 13 | 14 | class Object 15 | { 16 | public: 17 | Object() {} 18 | virtual ~Object() {} 19 | virtual bool intersect(const Ray& ray) = 0; 20 | virtual bool intersect(const Ray& ray, float &, uint32_t &) const = 0; 21 | virtual Intersection getIntersection(Ray _ray) = 0; 22 | virtual void getSurfaceProperties(const Vector3f &, const Vector3f &, const uint32_t &, const Vector2f &, Vector3f &, Vector2f &) const = 0; 23 | virtual Vector3f evalDiffuseColor(const Vector2f &) const =0; 24 | virtual Bounds3 getBounds()=0; 25 | }; 26 | 27 | 28 | 29 | #endif //RAYTRACING_OBJECT_H 30 | -------------------------------------------------------------------------------- /6/Ray.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 5/16/19. 3 | // 4 | 5 | #ifndef RAYTRACING_RAY_H 6 | #define RAYTRACING_RAY_H 7 | #include "Vector.hpp" 8 | struct Ray{ 9 | //Destination = origin + t*direction 10 | Vector3f origin; 11 | Vector3f direction, direction_inv; 12 | double t;//transportation time, 13 | double t_min, t_max; 14 | 15 | Ray(const Vector3f& ori, const Vector3f& dir, const double _t = 0.0): origin(ori), direction(dir),t(_t) { 16 | direction_inv = Vector3f(1./direction.x, 1./direction.y, 1./direction.z); 17 | t_min = 0.0; 18 | t_max = std::numeric_limits::max(); 19 | 20 | } 21 | 22 | Vector3f operator()(double t) const{return origin+direction*t;} 23 | 24 | friend std::ostream &operator<<(std::ostream& os, const Ray& r){ 25 | os<<"[origin:="< 3 | #include 4 | #include 5 | 6 | #undef M_PI 7 | #define M_PI 3.141592653589793f 8 | 9 | extern const float EPSILON; 10 | const float kInfinity = std::numeric_limits::max(); 11 | 12 | inline float clamp(const float &lo, const float &hi, const float &v) 13 | { return std::max(lo, std::min(hi, v)); } 14 | 15 | inline bool solveQuadratic(const float &a, const float &b, const float &c, float &x0, float &x1) 16 | { 17 | float discr = b * b - 4 * a * c; 18 | if (discr < 0) return false; 19 | else if (discr == 0) x0 = x1 = - 0.5 * b / a; 20 | else { 21 | float q = (b > 0) ? 22 | -0.5 * (b + sqrt(discr)) : 23 | -0.5 * (b - sqrt(discr)); 24 | x0 = q / a; 25 | x1 = c / q; 26 | } 27 | if (x0 > x1) std::swap(x0, x1); 28 | return true; 29 | } 30 | 31 | inline float get_random_float() 32 | { 33 | std::random_device dev; 34 | std::mt19937 rng(dev()); 35 | std::uniform_real_distribution dist(0.f, 1.f); // distribution in range [1, 6] 36 | 37 | return dist(rng); 38 | } 39 | 40 | inline void UpdateProgress(float progress) 41 | { 42 | int barWidth = 70; 43 | 44 | std::cout << "["; 45 | int pos = barWidth * progress; 46 | for (int i = 0; i < barWidth; ++i) { 47 | if (i < pos) std::cout << "="; 48 | else if (i == pos) std::cout << ">"; 49 | else std::cout << " "; 50 | } 51 | std::cout << "] " << int(progress * 100.0) << " %\r"; 52 | std::cout.flush(); 53 | }; 54 | -------------------------------------------------------------------------------- /6/images/binary.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/6/images/binary.ppm -------------------------------------------------------------------------------- /6/main.cpp: -------------------------------------------------------------------------------- 1 | #include "Renderer.hpp" 2 | #include "Scene.hpp" 3 | #include "Triangle.hpp" 4 | #include "Vector.hpp" 5 | #include "global.hpp" 6 | #include 7 | 8 | // In the main function of the program, we create the scene (create objects and 9 | // lights) as well as set the options for the render (image width and height, 10 | // maximum recursion depth, field-of-view, etc.). We then call the render 11 | // function(). 12 | int main(int argc, char** argv) 13 | { 14 | /* std::cout << std::numeric_limits::infinity() << std::endl; 15 | std::cout << std::numeric_limits::max() << std::endl; 16 | std::cout << std::numeric_limits::min() << std::endl;*/ 17 | 18 | Vector3f a(1,2,3); 19 | Scene scene(1280, 960); 20 | 21 | MeshTriangle bunny("../models/bunny/bunny.obj"); 22 | 23 | scene.Add(&bunny); 24 | scene.Add(std::make_unique(Vector3f(-20, 70, 20), 1)); 25 | scene.Add(std::make_unique(Vector3f(20, 70, 20), 1)); 26 | scene.buildBVH(); 27 | 28 | Renderer r; 29 | 30 | auto start = std::chrono::system_clock::now(); 31 | r.Render(scene); 32 | auto stop = std::chrono::system_clock::now(); 33 | 34 | std::cout << "Render complete: \n"; 35 | std::cout << "Time taken: " << std::chrono::duration_cast(stop - start).count() << " hours\n"; 36 | std::cout << " : " << std::chrono::duration_cast(stop - start).count() << " minutes\n"; 37 | std::cout << " : " << std::chrono::duration_cast(stop - start).count() << " seconds\n"; 38 | 39 | return 0; 40 | } -------------------------------------------------------------------------------- /7.5(only note)/readme.md: -------------------------------------------------------------------------------- 1 | # Assignment 7.5 2 | 3 | ## Task: 4 | 5 | Advanced Topics in Rendering 6 | 7 | Cameras, Lenses and Light Fields 8 | 9 | Color and Perception 10 | 11 | PPT: 18-20 12 | 13 | ## Recall: 14 | 15 | 1. Advanced Topics in Rendering 16 | 1. Light Transport 17 | 1. Unbiased: 18 | 1. Bidirectional Path Tracing (BDPT) : two directions. 19 | 2. Metropolis Light Transport (MLT) : Markov Chain Monte Carlo, locally. 20 | 2. Biased: 21 | 1. Photon Mapping (光子映射) : Specular-Diffuse-Specular (SDS). Firstly emit photons from the light source, stop on diffuse surfaces, then shoot sub-paths from the camera, hit on diffuse surfaces. 22 | 2. Vertex Connection and Merging (VCM) : BDPT + Photon Mapping. 23 | 3. Instant Radiosity (IR) 24 | 2. Appearance Modeling 25 | 1. Non-surface Models 26 | 1. Participating Media (参与介质) 27 | 2. Hair / fur (毛皮) / fiber (BCSDF) 28 | 3. Granular (颗粒状) Material 29 | 2. Surface Models 30 | 1. Translucent (半透明) Material (BSSRDF) 31 | 2. Cloth 32 | 3. Detailed Material (Non-statistical BRDF) 33 | 3. Procedural Appearance 34 | 2. Cameras, Lenses and Light Fields 35 | 1. Pinhole Image Formation 36 | 2. Field of View (FOV) 37 | 3. Exposure (曝光) 38 | 3. Color and Perception 39 | 1. The Plenoptic Function (全光函数). P(\theta, \phi, \lambda, t, x, y, z) 40 | 2. Lumigraph 41 | 3. Light Field Camera 42 | 4. Color 43 | 44 | -------------------------------------------------------------------------------- /7/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/7/.DS_Store -------------------------------------------------------------------------------- /7/AreaLight.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Göksu Güvendiren on 2019-05-14. 3 | // 4 | 5 | #pragma once 6 | 7 | #include "Vector.hpp" 8 | #include "Light.hpp" 9 | #include "global.hpp" 10 | 11 | class AreaLight : public Light 12 | { 13 | public: 14 | AreaLight(const Vector3f &p, const Vector3f &i) : Light(p, i) 15 | { 16 | normal = Vector3f(0, -1, 0); 17 | u = Vector3f(1, 0, 0); 18 | v = Vector3f(0, 0, 1); 19 | length = 100; 20 | } 21 | 22 | Vector3f SamplePoint() const 23 | { 24 | auto random_u = get_random_float(); 25 | auto random_v = get_random_float(); 26 | return position + random_u * u + random_v * v; 27 | } 28 | 29 | float length; 30 | Vector3f normal; 31 | Vector3f u; 32 | Vector3f v; 33 | }; 34 | -------------------------------------------------------------------------------- /7/BVH.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 5/16/19. 3 | // 4 | 5 | #ifndef RAYTRACING_BVH_H 6 | #define RAYTRACING_BVH_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "Object.hpp" 13 | #include "Ray.hpp" 14 | #include "Bounds3.hpp" 15 | #include "Intersection.hpp" 16 | #include "Vector.hpp" 17 | 18 | struct BVHBuildNode; 19 | // BVHAccel Forward Declarations 20 | struct BVHPrimitiveInfo; 21 | 22 | // BVHAccel Declarations 23 | inline int leafNodes, totalLeafNodes, totalPrimitives, interiorNodes; 24 | class BVHAccel { 25 | 26 | public: 27 | // BVHAccel Public Types 28 | enum class SplitMethod { NAIVE, SAH }; 29 | 30 | // BVHAccel Public Methods 31 | BVHAccel(std::vector p, int maxPrimsInNode = 1, SplitMethod splitMethod = SplitMethod::NAIVE); 32 | Bounds3 WorldBound() const; 33 | ~BVHAccel(); 34 | 35 | Intersection Intersect(const Ray &ray) const; 36 | Intersection getIntersection(BVHBuildNode* node, const Ray& ray)const; 37 | bool IntersectP(const Ray &ray) const; 38 | BVHBuildNode* root; 39 | 40 | // BVHAccel Private Methods 41 | BVHBuildNode* recursiveBuild(std::vectorobjects); 42 | 43 | // BVHAccel Private Data 44 | const int maxPrimsInNode; 45 | const SplitMethod splitMethod; 46 | std::vector primitives; 47 | 48 | void getSample(BVHBuildNode* node, float p, Intersection &pos, float &pdf); 49 | void Sample(Intersection &pos, float &pdf); 50 | }; 51 | 52 | struct BVHBuildNode { 53 | Bounds3 bounds; 54 | BVHBuildNode *left; 55 | BVHBuildNode *right; 56 | Object* object; 57 | float area; 58 | 59 | public: 60 | int splitAxis=0, firstPrimOffset=0, nPrimitives=0; 61 | // BVHBuildNode Public Methods 62 | BVHBuildNode(){ 63 | bounds = Bounds3(); 64 | left = nullptr;right = nullptr; 65 | object = nullptr; 66 | } 67 | }; 68 | 69 | 70 | 71 | 72 | #endif //RAYTRACING_BVH_H 73 | -------------------------------------------------------------------------------- /7/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(RayTracing) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | 6 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread") 7 | add_definitions(-O3) 8 | 9 | add_executable(RayTracing main.cpp Object.hpp Vector.cpp Vector.hpp Sphere.hpp global.hpp Triangle.hpp Scene.cpp 10 | Scene.hpp Light.hpp AreaLight.hpp BVH.cpp BVH.hpp Bounds3.hpp Ray.hpp Material.hpp Intersection.hpp 11 | Renderer.cpp Renderer.hpp) 12 | -------------------------------------------------------------------------------- /7/Intersection.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 5/16/19. 3 | // 4 | 5 | #ifndef RAYTRACING_INTERSECTION_H 6 | #define RAYTRACING_INTERSECTION_H 7 | #include "Vector.hpp" 8 | #include "Material.hpp" 9 | class Object; 10 | class Sphere; 11 | 12 | struct Intersection 13 | { 14 | Intersection(){ 15 | happened=false; 16 | coords=Vector3f(); 17 | normal=Vector3f(); 18 | distance= std::numeric_limits::max(); 19 | obj =nullptr; 20 | m=nullptr; 21 | } 22 | bool happened; 23 | Vector3f coords; 24 | Vector3f tcoords; 25 | Vector3f normal; 26 | Vector3f emit; 27 | double distance; 28 | Object* obj; 29 | Material* m; 30 | }; 31 | #endif //RAYTRACING_INTERSECTION_H 32 | -------------------------------------------------------------------------------- /7/Light.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Göksu Güvendiren on 2019-05-14. 3 | // 4 | 5 | #pragma once 6 | 7 | #include "Vector.hpp" 8 | 9 | class Light 10 | { 11 | public: 12 | Light(const Vector3f &p, const Vector3f &i) : position(p), intensity(i) {} 13 | virtual ~Light() = default; 14 | Vector3f position; 15 | Vector3f intensity; 16 | }; 17 | -------------------------------------------------------------------------------- /7/Object.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 5/13/19. 3 | // 4 | #pragma once 5 | #ifndef RAYTRACING_OBJECT_H 6 | #define RAYTRACING_OBJECT_H 7 | 8 | #include "Vector.hpp" 9 | #include "global.hpp" 10 | #include "Bounds3.hpp" 11 | #include "Ray.hpp" 12 | #include "Intersection.hpp" 13 | 14 | class Object 15 | { 16 | public: 17 | Object() {} 18 | virtual ~Object() {} 19 | virtual bool intersect(const Ray& ray) = 0; 20 | virtual bool intersect(const Ray& ray, float &, uint32_t &) const = 0; 21 | virtual Intersection getIntersection(Ray _ray) = 0; 22 | virtual void getSurfaceProperties(const Vector3f &, const Vector3f &, const uint32_t &, const Vector2f &, Vector3f &, Vector2f &) const = 0; 23 | virtual Vector3f evalDiffuseColor(const Vector2f &) const =0; 24 | virtual Bounds3 getBounds()=0; 25 | virtual float getArea()=0; 26 | virtual void Sample(Intersection &pos, float &pdf)=0; 27 | virtual bool hasEmit()=0; 28 | }; 29 | 30 | 31 | 32 | #endif //RAYTRACING_OBJECT_H 33 | -------------------------------------------------------------------------------- /7/Ray.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by LEI XU on 5/16/19. 3 | // 4 | 5 | #ifndef RAYTRACING_RAY_H 6 | #define RAYTRACING_RAY_H 7 | #include "Vector.hpp" 8 | struct Ray{ 9 | //Destination = origin + t*direction 10 | Vector3f origin; 11 | Vector3f direction, direction_inv; 12 | double t;//transportation time, 13 | double t_min, t_max; 14 | 15 | Ray(const Vector3f& ori, const Vector3f& dir, const double _t = 0.0): origin(ori), direction(dir),t(_t) { 16 | direction_inv = Vector3f(1./direction.x, 1./direction.y, 1./direction.z); 17 | t_min = 0.0; 18 | t_max = std::numeric_limits::max(); 19 | 20 | } 21 | 22 | Vector3f operator()(double t) const{return origin+direction*t;} 23 | 24 | friend std::ostream &operator<<(std::ostream& os, const Ray& r){ 25 | os<<"[origin:="< 3 | #include 4 | #include 5 | 6 | #undef M_PI 7 | #define M_PI 3.141592653589793f 8 | 9 | extern const float EPSILON; 10 | const float kInfinity = std::numeric_limits::max(); 11 | 12 | inline float clamp(const float &lo, const float &hi, const float &v) 13 | { return std::max(lo, std::min(hi, v)); } 14 | 15 | inline bool solveQuadratic(const float &a, const float &b, const float &c, float &x0, float &x1) 16 | { 17 | float discr = b * b - 4 * a * c; 18 | if (discr < 0) return false; 19 | else if (discr == 0) x0 = x1 = - 0.5 * b / a; 20 | else { 21 | float q = (b > 0) ? 22 | -0.5 * (b + sqrt(discr)) : 23 | -0.5 * (b - sqrt(discr)); 24 | x0 = q / a; 25 | x1 = c / q; 26 | } 27 | if (x0 > x1) std::swap(x0, x1); 28 | return true; 29 | } 30 | 31 | inline float get_random_float() 32 | { 33 | static std::random_device dev; 34 | static std::mt19937 rng(dev()); 35 | static std::uniform_real_distribution dist(0.f, 1.f); // distribution in range [1, 6] 36 | 37 | return dist(rng); 38 | } 39 | 40 | inline void UpdateProgress(float progress) 41 | { 42 | int barWidth = 70; 43 | 44 | std::cout << "["; 45 | int pos = barWidth * progress; 46 | for (int i = 0; i < barWidth; ++i) { 47 | if (i < pos) std::cout << "="; 48 | else if (i == pos) std::cout << ">"; 49 | else std::cout << " "; 50 | } 51 | std::cout << "] " << int(progress * 100.0) << " %\r"; 52 | std::cout.flush(); 53 | }; 54 | -------------------------------------------------------------------------------- /7/images/1-spp.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/7/images/1-spp.ppm -------------------------------------------------------------------------------- /7/images/16-spp.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/7/images/16-spp.ppm -------------------------------------------------------------------------------- /7/images/256-spp-microfacet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/7/images/256-spp-microfacet.png -------------------------------------------------------------------------------- /7/images/256-spp-microfacet.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/7/images/256-spp-microfacet.ppm -------------------------------------------------------------------------------- /7/images/256-spp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/7/images/256-spp.png -------------------------------------------------------------------------------- /7/images/256-spp.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/7/images/256-spp.ppm -------------------------------------------------------------------------------- /7/images/shade-exp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/7/images/shade-exp.png -------------------------------------------------------------------------------- /7/images/shade-func.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/7/images/shade-func.png -------------------------------------------------------------------------------- /7/models/cornellbox/floor.obj: -------------------------------------------------------------------------------- 1 | v 552.8 0.0 0.0 2 | v 0.0 0.0 0.0 3 | v 0.0 0.0 559.2 4 | v 549.6 0.0 559.2 5 | v 556.0 548.8 0.0 6 | v 556.0 548.8 559.2 7 | v 0.0 548.8 559.2 8 | v 0.0 548.8 0.0 9 | v 549.6 0.0 559.2 10 | v 0.0 0.0 559.2 11 | v 0.0 548.8 559.2 12 | v 556.0 548.8 559.2 13 | f 1 2 3 14 | f 3 4 1 15 | f 5 6 7 16 | f 7 8 5 17 | f 9 10 11 18 | f 11 12 9 -------------------------------------------------------------------------------- /7/models/cornellbox/left.obj: -------------------------------------------------------------------------------- 1 | v 552.8 0.0 0.0 2 | v 549.6 0.0 559.2 3 | v 556.0 548.8 559.2 4 | v 556.0 548.8 0.0 5 | f 1 2 3 6 | f 1 3 4 -------------------------------------------------------------------------------- /7/models/cornellbox/light.obj: -------------------------------------------------------------------------------- 1 | v 343.0 548.7 227.0 2 | v 343.0 548.7 332.0 3 | v 213.0 548.7 332.0 4 | v 213.0 548.7 227.0 5 | f 1 2 3 6 | f 1 3 4 -------------------------------------------------------------------------------- /7/models/cornellbox/right.obj: -------------------------------------------------------------------------------- 1 | v 0.0 0.0 559.2 2 | v 0.0 0.0 0.0 3 | v 0.0 548.8 0.0 4 | v 0.0 548.8 559.2 5 | f 1 2 3 6 | f 1 3 4 -------------------------------------------------------------------------------- /7/models/cornellbox/shortbox.obj: -------------------------------------------------------------------------------- 1 | v 130.0 165.0 65.0 2 | v 82.0 165.0 225.0 3 | v 240.0 165.0 272.0 4 | v 290.0 165.0 114.0 5 | v 290.0 0.0 114.0 6 | v 290.0 165.0 114.0 7 | v 240.0 165.0 272.0 8 | v 240.0 0.0 272.0 9 | v 130.0 0.0 65.0 10 | v 130.0 165.0 65.0 11 | v 290.0 165.0 114.0 12 | v 290.0 0.0 114.0 13 | v 82.0 0.0 225.0 14 | v 82.0 165.0 225.0 15 | v 130.0 165.0 65.0 16 | v 130.0 0.0 65.0 17 | v 240.0 0.0 272.0 18 | v 240.0 165.0 272.0 19 | v 82.0 165.0 225.0 20 | v 82.0 0.0 225.0 21 | f 1 2 3 22 | f 1 3 4 23 | f 5 6 7 24 | f 5 7 8 25 | f 9 10 11 26 | f 9 11 12 27 | f 13 14 15 28 | f 13 15 16 29 | f 17 18 19 30 | f 17 19 20 -------------------------------------------------------------------------------- /7/models/cornellbox/tallbox.obj: -------------------------------------------------------------------------------- 1 | v 423.0 330.0 247.0 2 | v 265.0 330.0 296.0 3 | v 314.0 330.0 456.0 4 | v 472.0 330.0 406.0 5 | v 423.0 0.0 247.0 6 | v 423.0 330.0 247.0 7 | v 472.0 330.0 406.0 8 | v 472.0 0.0 406.0 9 | v 472.0 0.0 406.0 10 | v 472.0 330.0 406.0 11 | v 314.0 330.0 456.0 12 | v 314.0 0.0 456.0 13 | v 314.0 0.0 456.0 14 | v 314.0 330.0 456.0 15 | v 265.0 330.0 296.0 16 | v 265.0 0.0 296.0 17 | v 265.0 0.0 296.0 18 | v 265.0 330.0 296.0 19 | v 423.0 330.0 247.0 20 | v 423.0 0.0 247.0 21 | f 1 2 3 22 | f 1 3 4 23 | f 5 6 7 24 | f 5 7 8 25 | f 9 10 11 26 | f 9 11 12 27 | f 13 14 15 28 | f 13 15 16 29 | f 17 18 19 30 | f 17 19 20 -------------------------------------------------------------------------------- /8/CGL/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_store -------------------------------------------------------------------------------- /8/CGL/cmake/modules/FindGLEW.cmake: -------------------------------------------------------------------------------- 1 | # - Find the OpenGL Extension Wrangler Library (GLEW) 2 | # This module defines the following variables: 3 | # GLEW_INCLUDE_DIRS - include directories for GLEW 4 | # GLEW_LIBRARIES - libraries to link against GLEW 5 | # GLEW_FOUND - true if GLEW has been found and can be used 6 | 7 | #============================================================================= 8 | # Copyright 2012 Benjamin Eikel 9 | # 10 | # Distributed under the OSI-approved BSD License (the "License"); 11 | # see accompanying file Copyright.txt for details. 12 | # 13 | # This software is distributed WITHOUT ANY WARRANTY; without even the 14 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | # See the License for more information. 16 | #============================================================================= 17 | # (To distribute this file outside of CMake, substitute the full 18 | # License text for the above reference.) 19 | 20 | find_path(GLEW_INCLUDE_DIR GL/glew.h) 21 | find_library(GLEW_LIBRARY NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64) 22 | 23 | set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR}) 24 | set(GLEW_LIBRARIES ${GLEW_LIBRARY}) 25 | 26 | include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) 27 | find_package_handle_standard_args(GLEW 28 | REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY) 29 | 30 | mark_as_advanced(GLEW_INCLUDE_DIR GLEW_LIBRARY) 31 | -------------------------------------------------------------------------------- /8/CGL/deps/glew/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GLEW_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) 2 | 3 | set(GLEW_SOURCE_DIR ${GLEW_ROOT_DIR}/src) 4 | set(GLEW_HEADER_DIR ${GLEW_ROOT_DIR}/include) 5 | 6 | include_directories(${GLEW_HEADER_DIR}) 7 | add_library(glew 8 | ${GLEW_SOURCE_DIR}/glew.c 9 | ${GLEW_SOURCE_DIR}/glewinfo.c 10 | ${GLEW_SOURCE_DIR}/visualinfo.c) 11 | 12 | set(GLEW_LIBRARIES glew PARENT_SCOPE) 13 | set(GLEW_INCLUDE_DIRS ${GLEW_HEADER_DIR} PARENT_SCOPE) 14 | 15 | install(TARGETS glew DESTINATION lib) 16 | install(DIRECTORY ${GLEW_HEADER_DIR}/GL DESTINATION include) 17 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/AppleInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${APPLE_GUI_EXECUTABLE} 9 | CFBundleGetInfoString 10 | ${APPLE_GUI_INFO_STRING} 11 | CFBundleIconFile 12 | ${APPLE_GUI_ICON} 13 | CFBundleIdentifier 14 | ${APPLE_GUI_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | ${APPLE_GUI_LONG_VERSION_STRING} 19 | CFBundleName 20 | ${APPLE_GUI_BUNDLE_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | ${APPLE_GUI_SHORT_VERSION_STRING} 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | ${APPLE_GUI_BUNDLE_VERSION} 29 | CSResourcesFileMapped 30 | 31 | LSRequiresCarbon 32 | 33 | NSHumanReadableCopyright 34 | ${APPLE_GUI_COPYRIGHT} 35 | NSHighResolutionCapable 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/amd64-mingw32msvc.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win64 2 | SET(CMAKE_SYSTEM_NAME Windows) 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "amd64-mingw32msvc-gcc") 5 | SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++") 6 | SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres") 7 | SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/amd64-mingw32msvc") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/i586-mingw32msvc.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i586-mingw32msvc-gcc") 5 | SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++") 6 | SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres") 7 | SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/i686-pc-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-pc-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib") 8 | 9 | #Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/opt/mingw/usr/i686-pc-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/i686-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/modules/FindEGL.cmake: -------------------------------------------------------------------------------- 1 | # Find EGL 2 | # 3 | # EGL_INCLUDE_DIR 4 | # EGL_LIBRARY 5 | # EGL_FOUND 6 | 7 | find_path(EGL_INCLUDE_DIR NAMES EGL/egl.h PATHS /opt/vc/include) 8 | 9 | set(EGL_NAMES ${EGL_NAMES} egl EGL) 10 | find_library(EGL_LIBRARY NAMES ${EGL_NAMES} PATHS /opt/vc/lib) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR) 14 | 15 | mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY) 16 | 17 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/modules/FindGLESv1.cmake: -------------------------------------------------------------------------------- 1 | # Find GLESv1 2 | # 3 | # GLESv1_INCLUDE_DIR 4 | # GLESv1_LIBRARY 5 | # GLESv1_FOUND 6 | 7 | find_path(GLESv1_INCLUDE_DIR NAMES GLES/gl.h PATHS /opt/vc/include) 8 | 9 | set(GLESv1_NAMES ${GLESv1_NAMES} GLESv1_CM) 10 | find_library(GLESv1_LIBRARY NAMES ${GLESv1_NAMES} PATHS /opt/vc/lib) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(GLESv1 DEFAULT_MSG GLESv1_LIBRARY GLESv1_INCLUDE_DIR) 14 | 15 | mark_as_advanced(GLESv1_INCLUDE_DIR GLESv1_LIBRARY) 16 | 17 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/modules/FindGLESv2.cmake: -------------------------------------------------------------------------------- 1 | # Find GLESv2 2 | # 3 | # GLESv2_INCLUDE_DIR 4 | # GLESv2_LIBRARY 5 | # GLESv2_FOUND 6 | 7 | find_path(GLESv2_INCLUDE_DIR NAMES GLES2/gl2.h PATHS /opt/vc/include) 8 | 9 | set(GLESv2_NAMES ${GLESv2_NAMES} GLESv2) 10 | find_library(GLESv2_LIBRARY NAMES ${GLESv2_NAMES} PATHS /opt/vc/lib) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(GLESv2 DEFAULT_MSG GLESv2_LIBRARY GLESv2_INCLUDE_DIR) 14 | 15 | mark_as_advanced(GLESv2_INCLUDE_DIR GLESv2_LIBRARY) 16 | 17 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/modules/FindMir.cmake: -------------------------------------------------------------------------------- 1 | # Try to find Mir on a Unix system 2 | # 3 | # This will define: 4 | # 5 | # MIR_LIBRARIES - Link these to use Wayland 6 | # MIR_INCLUDE_DIR - Include directory for Wayland 7 | # 8 | # Copyright (c) 2014 Brandon Schaefer 9 | 10 | if (NOT WIN32) 11 | 12 | find_package (PkgConfig) 13 | pkg_check_modules (PKG_MIR QUIET mirclient) 14 | 15 | set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS}) 16 | set (MIR_LIBRARIES ${PKG_MIR_LIBRARIES}) 17 | 18 | endif () 19 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/modules/FindXKBCommon.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find XKBCommon 2 | # Once done, this will define 3 | # 4 | # XKBCOMMON_FOUND - System has XKBCommon 5 | # XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories 6 | # XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon 7 | # XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon 8 | 9 | find_package(PkgConfig) 10 | pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon) 11 | set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER}) 12 | 13 | find_path(XKBCOMMON_INCLUDE_DIR 14 | NAMES xkbcommon/xkbcommon.h 15 | HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} 16 | ) 17 | 18 | find_library(XKBCOMMON_LIBRARY 19 | NAMES xkbcommon 20 | HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS} 21 | ) 22 | 23 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) 24 | set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS}) 25 | set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR}) 26 | 27 | include(FindPackageHandleStandardArgs) 28 | find_package_handle_standard_args(XKBCommon DEFAULT_MSG 29 | XKBCOMMON_LIBRARY 30 | XKBCOMMON_INCLUDE_DIR 31 | ) 32 | 33 | mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) 34 | 35 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/CMake/x86_64-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | Copyright (c) 2006-2010 Camilla Berglund 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would 15 | be appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not 18 | be misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | 23 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 4 | endif() 5 | 6 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 7 | string(REGEX REPLACE "\n" ";" files "${files}") 8 | 9 | foreach (file ${files}) 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | if (EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 13 | OUTPUT_VARIABLE rm_out 14 | RETURN_VALUE rm_retval) 15 | if (NOT "${rm_retval}" STREQUAL 0) 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | endif() 18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}") 19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 20 | OUTPUT_VARIABLE rm_out 21 | RETURN_VALUE rm_retval) 22 | if (NOT "${rm_retval}" STREQUAL 0) 23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") 24 | endif() 25 | else() 26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 27 | endif() 28 | endforeach() 29 | 30 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_custom_target(docs ALL ${DOXYGEN_EXECUTABLE} 3 | WORKING_DIRECTORY ${GLFW_BINARY_DIR}/docs 4 | COMMENT "Generating HTML documentation" VERBATIM) 5 | 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/footer.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | $projectname: $title 8 | $title 9 | 10 | 11 | 12 | $treeview 13 | $search 14 | $mathjax 15 | 16 | $extrastylesheet 17 | 18 | 19 |
20 | 21 | 22 |
23 |
24 | GLFW 25 | 31 |
32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/bc_s.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/bdwn.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/closed.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/doxygen.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2blank.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2cl.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2doc.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2folderopen.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2lastnode.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2link.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2mnode.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2mo.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2node.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2ns.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2plastnode.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2pnode.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2splitbar.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/ftv2vertline.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/nav_f.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/nav_g.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/nav_h.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/open.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['blue',['blue',['../structGLFWgammaramp.html#acf0c836d0efe29c392fe8d1a1042744b',1,'GLFWgammaramp']]], 4 | ['bluebits',['blueBits',['../structGLFWvidmode.html#af310977f58d2e3b188175b6e3d314047',1,'GLFWvidmode']]], 5 | ['bug_20list',['Bug List',['../bug.html',1,'']]], 6 | ['building_20applications',['Building applications',['../build.html',1,'']]], 7 | ['build_2edox',['build.dox',['../build_8dox.html',1,'']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['compat_2edox',['compat.dox',['../compat_8dox.html',1,'']]], 4 | ['compiling_20glfw',['Compiling GLFW',['../compile.html',1,'']]], 5 | ['compile_2edox',['compile.dox',['../compile_8dox.html',1,'']]], 6 | ['context_20handling',['Context handling',['../group__context.html',1,'(Global Namespace)'],['../context.html',1,'(Global Namespace)']]], 7 | ['context_2edox',['context.dox',['../context_8dox.html',1,'']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['error_20codes',['Error codes',['../group__errors.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['height',['height',['../structGLFWvidmode.html#ac65942a5f6981695517437a9d571d03c',1,'GLFWvidmode::height()'],['../structGLFWimage.html#a0b7d95368f0c80d5e5c9875057c7dbec',1,'GLFWimage::height()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['initialization_2c_20version_20and_20errors',['Initialization, version and errors',['../group__init.html',1,'']]], 4 | ['input_20handling',['Input handling',['../group__input.html',1,'(Global Namespace)'],['../input.html',1,'(Global Namespace)']]], 5 | ['input_2edox',['input.dox',['../input_8dox.html',1,'']]], 6 | ['introduction_20to_20the_20api',['Introduction to the API',['../intro.html',1,'']]], 7 | ['intro_2edox',['intro.dox',['../intro_8dox.html',1,'']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['joysticks',['Joysticks',['../group__joysticks.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['keyboard_20keys',['Keyboard keys',['../group__keys.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mouse_20buttons',['Mouse buttons',['../group__buttons.html',1,'']]], 4 | ['main_2edox',['main.dox',['../main_8dox.html',1,'']]], 5 | ['modifier_20key_20flags',['Modifier key flags',['../group__mods.html',1,'']]], 6 | ['monitor_20handling',['Monitor handling',['../group__monitor.html',1,'(Global Namespace)'],['../monitor.html',1,'(Global Namespace)']]], 7 | ['monitor_2edox',['monitor.dox',['../monitor_8dox.html',1,'']]], 8 | ['moving_20from_20glfw_202_20to_203',['Moving from GLFW 2 to 3',['../moving.html',1,'']]], 9 | ['moving_2edox',['moving.dox',['../moving_8dox.html',1,'']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['notitle',['notitle',['../index.html',1,'']]], 4 | ['native_20access',['Native access',['../group__native.html',1,'']]], 5 | ['new_20features',['New features',['../news.html',1,'']]], 6 | ['news_2edox',['news.dox',['../news_8dox.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['oculus_20rift_20guide',['Oculus Rift guide',['../rift.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['pixels',['pixels',['../structGLFWimage.html#a0c532a5c2bb715555279b7817daba0fb',1,'GLFWimage']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['quick_2edox',['quick.dox',['../quick_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['red',['red',['../structGLFWgammaramp.html#a2cce5d968734b685623eef913e635138',1,'GLFWgammaramp']]], 4 | ['redbits',['redBits',['../structGLFWvidmode.html#a6066c4ecd251098700062d3b735dba1b',1,'GLFWvidmode']]], 5 | ['refreshrate',['refreshRate',['../structGLFWvidmode.html#a791bdd6c7697b09f7e9c97054bf05649',1,'GLFWvidmode']]], 6 | ['rift_2edox',['rift.dox',['../rift_8dox.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['standards_20conformance',['Standards conformance',['../compat.html',1,'']]], 4 | ['standard_20cursor_20shapes',['Standard cursor shapes',['../group__shapes.html',1,'']]], 5 | ['size',['size',['../structGLFWgammaramp.html#ad620e1cffbff9a32c51bca46301b59a5',1,'GLFWgammaramp']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/all_f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['width',['width',['../structGLFWvidmode.html#a698dcb200562051a7249cb6ae154c71d',1,'GLFWvidmode::width()'],['../structGLFWimage.html#af6a71cc999fe6d3aea31dd7e9687d835',1,'GLFWimage::width()']]], 4 | ['window_20handling',['Window handling',['../group__window.html',1,'(Global Namespace)'],['../window.html',1,'(Global Namespace)']]], 5 | ['window_2edox',['window.dox',['../window_8dox.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['glfwgammaramp',['GLFWgammaramp',['../structGLFWgammaramp.html',1,'']]], 4 | ['glfwimage',['GLFWimage',['../structGLFWimage.html',1,'']]], 5 | ['glfwvidmode',['GLFWvidmode',['../structGLFWvidmode.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/search/close.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/defines_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['build_2edox',['build.dox',['../build_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['compat_2edox',['compat.dox',['../compat_8dox.html',1,'']]], 4 | ['compile_2edox',['compile.dox',['../compile_8dox.html',1,'']]], 5 | ['context_2edox',['context.dox',['../context_8dox.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['glfw3_2eh',['glfw3.h',['../glfw3_8h.html',1,'']]], 4 | ['glfw3native_2eh',['glfw3native.h',['../glfw3native_8h.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['input_2edox',['input.dox',['../input_8dox.html',1,'']]], 4 | ['intro_2edox',['intro.dox',['../intro_8dox.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['main_2edox',['main.dox',['../main_8dox.html',1,'']]], 4 | ['monitor_2edox',['monitor.dox',['../monitor_8dox.html',1,'']]], 5 | ['moving_2edox',['moving.dox',['../moving_8dox.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['news_2edox',['news.dox',['../news_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['quick_2edox',['quick.dox',['../quick_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['rift_2edox',['rift.dox',['../rift_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/files_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['window_2edox',['window.dox',['../window_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['context_20handling',['Context handling',['../group__context.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['error_20codes',['Error codes',['../group__errors.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['initialization_2c_20version_20and_20errors',['Initialization, version and errors',['../group__init.html',1,'']]], 4 | ['input_20handling',['Input handling',['../group__input.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['joysticks',['Joysticks',['../group__joysticks.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['keyboard_20keys',['Keyboard keys',['../group__keys.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mouse_20buttons',['Mouse buttons',['../group__buttons.html',1,'']]], 4 | ['modifier_20key_20flags',['Modifier key flags',['../group__mods.html',1,'']]], 5 | ['monitor_20handling',['Monitor handling',['../group__monitor.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['native_20access',['Native access',['../group__native.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['standard_20cursor_20shapes',['Standard cursor shapes',['../group__shapes.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/groups_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['window_20handling',['Window handling',['../group__window.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/mag_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/search/mag_sel.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
No Matches
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['bug_20list',['Bug List',['../bug.html',1,'']]], 4 | ['building_20applications',['Building applications',['../build.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['compiling_20glfw',['Compiling GLFW',['../compile.html',1,'']]], 4 | ['context_20guide',['Context guide',['../context.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['getting_20started',['Getting started',['../quick.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['input_20guide',['Input guide',['../input.html',1,'']]], 4 | ['introduction_20to_20the_20api',['Introduction to the API',['../intro.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['monitor_20guide',['Monitor guide',['../monitor.html',1,'']]], 4 | ['moving_20from_20glfw_202_20to_203',['Moving from GLFW 2 to 3',['../moving.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['notitle',['notitle',['../index.html',1,'']]], 4 | ['new_20features',['New features',['../news.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['oculus_20rift_20guide',['Oculus Rift guide',['../rift.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['standards_20conformance',['Standards conformance',['../compat.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/pages_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['window_20guide',['Window guide',['../window.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/search/search_l.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/search/search_m.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/search/search_r.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/typedefs_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['blue',['blue',['../structGLFWgammaramp.html#acf0c836d0efe29c392fe8d1a1042744b',1,'GLFWgammaramp']]], 4 | ['bluebits',['blueBits',['../structGLFWvidmode.html#af310977f58d2e3b188175b6e3d314047',1,'GLFWvidmode']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['green',['green',['../structGLFWgammaramp.html#affccc6f5df47820b6562d709da3a5a3a',1,'GLFWgammaramp']]], 4 | ['greenbits',['greenBits',['../structGLFWvidmode.html#a292fdd281f3485fb3ff102a5bda43faa',1,'GLFWvidmode']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['height',['height',['../structGLFWvidmode.html#ac65942a5f6981695517437a9d571d03c',1,'GLFWvidmode::height()'],['../structGLFWimage.html#a0b7d95368f0c80d5e5c9875057c7dbec',1,'GLFWimage::height()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['pixels',['pixels',['../structGLFWimage.html#a0c532a5c2bb715555279b7817daba0fb',1,'GLFWimage']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['red',['red',['../structGLFWgammaramp.html#a2cce5d968734b685623eef913e635138',1,'GLFWgammaramp']]], 4 | ['redbits',['redBits',['../structGLFWvidmode.html#a6066c4ecd251098700062d3b735dba1b',1,'GLFWvidmode']]], 5 | ['refreshrate',['refreshRate',['../structGLFWvidmode.html#a791bdd6c7697b09f7e9c97054bf05649',1,'GLFWvidmode']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['size',['size',['../structGLFWgammaramp.html#ad620e1cffbff9a32c51bca46301b59a5',1,'GLFWgammaramp']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/search/variables_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['width',['width',['../structGLFWvidmode.html#a698dcb200562051a7249cb6ae154c71d',1,'GLFWvidmode::width()'],['../structGLFWimage.html#af6a71cc999fe6d3aea31dd7e9687d835',1,'GLFWimage::width()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/sync_off.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/sync_on.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/tab_a.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/tab_b.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/tab_h.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DQSSSSS/GAMES101_Assignment/d3d4acc3ed9893989c6c493f9304fe218356aa00/8/CGL/deps/glfw/docs/html/tab_s.png -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/docs/main.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | @mainpage notitle 4 | 5 | @section main_intro Introduction 6 | 7 | __GLFW__ is a free, Open Source, multi-platform library for creating windows 8 | with OpenGL or OpenGL ES contexts and receiving many kinds of input. It is easy 9 | to integrate into existing applications and does not lay claim to the main loop. 10 | 11 | See @ref news_31 for release highlights or the 12 | [version history](http://www.glfw.org/changelog.html) for details. 13 | 14 | @ref quick is a guide for those new to GLFW. It takes you through how to write 15 | a small but complete program. For people coming from GLFW 2, the @ref moving 16 | guide explains what has changed and how to update existing code to use the new 17 | API. 18 | 19 | There are guides for each of the various areas of the API. 20 | 21 | - @ref intro – initialization, error handling and high-level design 22 | - @ref window – creating and working with windows and framebuffers 23 | - @ref context – working with OpenGL and OpenGL ES contexts 24 | - @ref monitor – enumerating and working with monitors and video modes 25 | - @ref input – receiving events, polling and processing input 26 | 27 | Once you have written a program, see the @ref compile and @ref build guides. 28 | 29 | The [reference documentation](modules.html) provides more detailed information 30 | about specific functions. 31 | 32 | There is a section on @ref guarantees_limitations for pointer lifetimes, 33 | reentrancy, thread safety, event order and backward and forward compatibility. 34 | 35 | The @ref rift fills in the gaps for how to use LibOVR with GLFW. 36 | 37 | The [FAQ](http://www.glfw.org/faq.html) answers many common questions about the 38 | design, implementation and use of GLFW. 39 | 40 | Finally, the @ref compat guide explains what APIs, standards and protocols GLFW 41 | uses and what happens when they are not present on a given machine. 42 | 43 | This documentation was generated with Doxygen. The sources for it are available 44 | in both the [source distribution](http://www.glfw.org/download.html) and 45 | [GitHub repository](https://github.com/glfw/glfw). 46 | 47 | */ 48 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/src/glfw3.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${exec_prefix}/lib@LIB_SUFFIX@ 5 | 6 | Name: GLFW 7 | Description: A multi-platform library for OpenGL, window and input 8 | Version: @GLFW_VERSION_FULL@ 9 | URL: http://www.glfw.org/ 10 | Requires.private: @GLFW_PKG_DEPS@ 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@ 12 | Libs.private: @GLFW_PKG_LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/src/glfw3Config.cmake.in: -------------------------------------------------------------------------------- 1 | # - Config file for the glfw3 package 2 | # It defines the following variables 3 | # GLFW3_INCLUDE_DIR, the path where GLFW headers are located 4 | # GLFW3_LIBRARY_DIR, folder in which the GLFW library is located 5 | # GLFW3_LIBRARY, library to link against to use GLFW 6 | 7 | set(GLFW3_VERSION "@GLFW_VERSION_FULL@") 8 | 9 | @PACKAGE_INIT@ 10 | 11 | set_and_check(GLFW3_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/include") 12 | set_and_check(GLFW3_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@") 13 | 14 | find_library(GLFW3_LIBRARY "@GLFW_LIB_NAME@" HINTS ${GLFW3_LIBRARY_DIR}) 15 | 16 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/src/iokit_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 IOKit - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2014 Camilla Berglund 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #ifndef _iokit_joystick_h_ 28 | #define _iokit_joystick_h_ 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ 36 | _GLFWjoystickIOKit iokit_js[GLFW_JOYSTICK_LAST + 1] 37 | 38 | 39 | // IOKit-specific per-joystick data 40 | // 41 | typedef struct _GLFWjoystickIOKit 42 | { 43 | int present; 44 | char name[256]; 45 | 46 | IOHIDDeviceInterface** interface; 47 | 48 | CFMutableArrayRef axisElements; 49 | CFMutableArrayRef buttonElements; 50 | CFMutableArrayRef hatElements; 51 | 52 | float* axes; 53 | unsigned char* buttons; 54 | 55 | } _GLFWjoystickIOKit; 56 | 57 | 58 | void _glfwInitJoysticks(void); 59 | void _glfwTerminateJoysticks(void); 60 | 61 | #endif // _iokit_joystick_h_ 62 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/src/posix_time.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #ifndef _posix_time_h_ 29 | #define _posix_time_h_ 30 | 31 | #define _GLFW_PLATFORM_LIBRARY_TIME_STATE _GLFWtimePOSIX posix_time 32 | 33 | #include 34 | 35 | 36 | // POSIX-specific global timer data 37 | // 38 | typedef struct _GLFWtimePOSIX 39 | { 40 | GLboolean monotonic; 41 | double resolution; 42 | uint64_t base; 43 | 44 | } _GLFWtimePOSIX; 45 | 46 | 47 | void _glfwInitTimer(void); 48 | 49 | #endif // _posix_time_h_ 50 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/src/posix_tls.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #ifndef _posix_tls_h_ 29 | #define _posix_tls_h_ 30 | 31 | #include 32 | 33 | #define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsPOSIX posix_tls 34 | 35 | 36 | // POSIX-specific global TLS data 37 | // 38 | typedef struct _GLFWtlsPOSIX 39 | { 40 | pthread_key_t context; 41 | 42 | } _GLFWtlsPOSIX; 43 | 44 | 45 | int _glfwInitTLS(void); 46 | void _glfwTerminateTLS(void); 47 | void _glfwSetCurrentContext(_GLFWwindow* context); 48 | 49 | #endif // _posix_tls_h_ 50 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/src/win32_tls.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #ifndef _win32_tls_h_ 29 | #define _win32_tls_h_ 30 | 31 | #define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsWin32 win32_tls 32 | 33 | 34 | // Win32-specific global TLS data 35 | // 36 | typedef struct _GLFWtlsWin32 37 | { 38 | GLboolean allocated; 39 | DWORD context; 40 | 41 | } _GLFWtlsWin32; 42 | 43 | 44 | int _glfwInitTLS(void); 45 | void _glfwTerminateTLS(void); 46 | void _glfwSetCurrentContext(_GLFWwindow* context); 47 | 48 | #endif // _win32_tls_h_ 49 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/src/winmm_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 WinMM - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2014 Camilla Berglund 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #ifndef _winmm_joystick_h_ 28 | #define _winmm_joystick_h_ 29 | 30 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ 31 | _GLFWjoystickWinMM winmm_js[GLFW_JOYSTICK_LAST + 1] 32 | 33 | 34 | // WinMM-specific per-joystick data 35 | // 36 | typedef struct _GLFWjoystickWinMM 37 | { 38 | float axes[6]; 39 | unsigned char buttons[36]; // 32 buttons plus one hat 40 | char* name; 41 | } _GLFWjoystickWinMM; 42 | 43 | 44 | void _glfwInitJoysticks(void); 45 | void _glfwTerminateJoysticks(void); 46 | 47 | #endif // _winmm_joystick_h_ 48 | -------------------------------------------------------------------------------- /8/CGL/deps/glfw/src/xkb_unicode.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #ifndef _xkb_unicode_h_ 28 | #define _xkb_unicode_h_ 29 | 30 | 31 | long _glfwKeySym2Unicode(unsigned int keysym); 32 | 33 | #endif // _xkb_unicode_h_ 34 | -------------------------------------------------------------------------------- /8/CGL/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_libraries(CGL) 2 | 3 | include_directories("${PROJECT_SOURCE_DIR}/src") 4 | 5 | link_libraries( 6 | glfw ${GLFW_LIBRARIES} 7 | glew ${GLEW_LIBRARIES} 8 | ${OPENGL_LIBRARIES} 9 | ${FREETYPE_LIBRARIES} 10 | ) 11 | 12 | add_executable(triangle triangle.cpp) 13 | add_executable(text text.cpp) 14 | 15 | # Install examples 16 | install(TARGETS triangle DESTINATION bin/examples) -------------------------------------------------------------------------------- /8/CGL/examples/text.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "viewer.h" 5 | #include "renderer.h" 6 | 7 | using namespace std; 8 | using namespace CGL; 9 | 10 | class TextDrawer : public Renderer { 11 | public: 12 | 13 | ~TextDrawer() { } 14 | 15 | string name() { 16 | return "Text Renderer"; 17 | } 18 | 19 | string info() { 20 | return "I just draw a bunch of text on screen"; 21 | } 22 | 23 | void init() { 24 | 25 | text_mgr.init(use_hdpi); 26 | 27 | size = 16; 28 | line0 = text_mgr.add_line(0.0, 0.0, "Hi there!", size, Color::White); 29 | 30 | return; 31 | } 32 | 33 | void render() { 34 | 35 | text_mgr.render(); 36 | 37 | } 38 | 39 | void resize(size_t w, size_t h) { 40 | 41 | this->w = w; 42 | this->h = h; 43 | 44 | text_mgr.resize(w,h); 45 | 46 | return; 47 | } 48 | 49 | void cursor_event(float x, float y, unsigned char keys) { 50 | if (keys & (1 << 2)) { 51 | text_mgr.set_anchor(line0, 2 * (x - .5 * w) / w, 2 * (.5 * h - y) / h); 52 | } 53 | } 54 | 55 | void scroll_event(float offset_x, float offset_y) { 56 | size += int(offset_y + offset_x); 57 | text_mgr.set_size(line0, size); 58 | } 59 | 60 | 61 | private: 62 | 63 | // OSD text manager 64 | OSDText text_mgr; 65 | 66 | // my line id's 67 | int line0; 68 | 69 | // my line's font size 70 | size_t size; 71 | 72 | // frame buffer size 73 | size_t w, h; 74 | 75 | }; 76 | 77 | 78 | int main( int argc, char** argv ) { 79 | 80 | // create viewer 81 | Viewer viewer = Viewer(); 82 | 83 | // defined a user space renderer 84 | Renderer* renderer = new TextDrawer(); 85 | 86 | // set user space renderer 87 | viewer.set_renderer(renderer); 88 | 89 | // start the viewer 90 | viewer.init(); 91 | viewer.start(); 92 | 93 | return 0; 94 | } 95 | -------------------------------------------------------------------------------- /8/CGL/include/CGL/CGL.h: -------------------------------------------------------------------------------- 1 | #include "vector2D.h" 2 | #include "complex.h" 3 | 4 | #include "vector3D.h" 5 | #include "matrix3x3.h" 6 | 7 | #include "vector4D.h" 8 | #include "matrix4x4.h" 9 | 10 | // quaternions seem pretty cool. 11 | #include "quaternion.h" 12 | 13 | 14 | #include "color.h" 15 | #include "renderer.h" 16 | #include "viewer.h" 17 | 18 | #include "base64.h" 19 | #include "tinyxml2.h" 20 | -------------------------------------------------------------------------------- /8/CGL/include/CGL/base64.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | std::string base64_encode(unsigned char const* , unsigned int len); 4 | std::string base64_decode(std::string const& s); -------------------------------------------------------------------------------- /8/CGL/include/CGL/misc.h: -------------------------------------------------------------------------------- 1 | #ifndef CGL_MISC_H 2 | #define CGL_MISC_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace CGL { 9 | 10 | #define PI (3.14159265358979323) 11 | #define EPS_D (0.00000000001) 12 | #define EPS_F (0.00001f) 13 | #define INF_D (std::numeric_limits::infinity()) 14 | #define INF_F (std::numeric_limits::infinity()) 15 | 16 | // MOUSE INPUTS // 17 | #define MOUSE_LEFT 0 18 | #define MOUSE_RIGHT 1 19 | #define MOUSE_MIDDLE 2 20 | 21 | // KEYBOARD INPUTS // 22 | #define KEYBOARD_ENTER 257 23 | #define KEYBOARD_TAB 258 24 | #define KEYBOARD_BACKSPACE 259 25 | #define KEYBOARD_INSERT 260 26 | #define KEYBOARD_DELETE 261 27 | #define KEYBOARD_RIGHT 262 28 | #define KEYBOARD_LEFT 263 29 | #define KEYBOARD_DOWN 264 30 | #define KEYBOARD_UP 265 31 | #define KEYBOARD_PAGE_UP 266 32 | #define KEYBOARD_PAGE_DOWN 267 33 | #define KEYBOARD_PRINT_SCREEN 283 34 | 35 | // EVENT TYPES // 36 | #define EVENT_RELEASE 0 37 | #define EVENT_PRESS 1 38 | #define EVENT_REPEAT 2 39 | 40 | // MODIFIERS // 41 | #define MOD_SHIFT 0x0001 42 | #define MOD_CTRL 0x0002 43 | #define MOD_ALT 0x0004 44 | #define MOD_SUPER 0x0008 45 | 46 | /* 47 | Takes any kind of number and converts from degrees to radians. 48 | */ 49 | template 50 | inline T radians(T deg) { 51 | return deg * (PI / 180); 52 | } 53 | 54 | /* 55 | Takes any kind of number and converts from radians to degrees. 56 | */ 57 | template 58 | inline T degrees(T rad) { 59 | return rad * (180 / PI); 60 | } 61 | 62 | /* 63 | Takes any kind of number, as well as a lower and upper bound, and clamps the 64 | number to be within the bound. 65 | NOTE: x, lo, and hi must all be the same type or compilation will fail. A 66 | common mistake is to pass an int for x and size_ts for lo and hi. 67 | */ 68 | template 69 | inline T clamp(T x, T lo, T hi) { 70 | return std::min(std::max(x, lo), hi); 71 | } 72 | 73 | } // namespace CGL 74 | 75 | #endif // CGL_MISCMATH_H 76 | -------------------------------------------------------------------------------- /8/CGL/src/CGL.h: -------------------------------------------------------------------------------- 1 | #include "vector2D.h" 2 | #include "complex.h" 3 | 4 | #include "vector3D.h" 5 | #include "matrix3x3.h" 6 | 7 | #include "vector4D.h" 8 | #include "matrix4x4.h" 9 | 10 | // quaternions seem pretty cool. 11 | #include "quaternion.h" 12 | 13 | 14 | #include "color.h" 15 | #include "renderer.h" 16 | #include "viewer.h" 17 | 18 | #include "base64.h" 19 | #include "tinyxml2.h" 20 | -------------------------------------------------------------------------------- /8/CGL/src/base64.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | std::string base64_encode(unsigned char const* , unsigned int len); 4 | std::string base64_decode(std::string const& s); -------------------------------------------------------------------------------- /8/CGL/src/color.cpp: -------------------------------------------------------------------------------- 1 | #include "color.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | namespace CGL { 11 | 12 | // Constants 13 | const Color Color::White = Color(1,1,1,1); 14 | const Color Color::Black = Color(0,0,0,1); 15 | 16 | Color::Color( const unsigned char* arr ) { 17 | float inv = 1.0 / 255.0; 18 | r = arr[0] * inv; 19 | g = arr[1] * inv; 20 | b = arr[2] * inv; 21 | a = 1.0; 22 | } 23 | 24 | Color Color::fromHex( const char* s ) { 25 | // If the color is "none", return any color 26 | // with alpha zero (completely transparent). 27 | if( !strcmp(s, "none") ) { 28 | return Color(0,0,0,0); 29 | } 30 | 31 | // Ignore leading hashmark. 32 | if( s[0] == '#' ) { 33 | s++; 34 | } 35 | 36 | // Set stream formatting to hexadecimal. 37 | stringstream ss; 38 | ss << hex; 39 | 40 | // Convert to integer. 41 | unsigned int rgb; 42 | ss << s; 43 | ss >> rgb; 44 | 45 | // Extract 8-byte chunks and normalize. 46 | Color c; 47 | c.r = (float)( ( rgb & 0xFF0000 ) >> 16 ) / 255.0; 48 | c.g = (float)( ( rgb & 0x00FF00 ) >> 8 ) / 255.0; 49 | c.b = (float)( ( rgb & 0x0000FF ) >> 0 ) / 255.0; 50 | c.a = 1.0; // set alpha to 1 (opaque) by default 51 | 52 | return c; 53 | } 54 | 55 | string Color::toHex( void ) const { 56 | int R = (unsigned char) max( 0., min( 255.0, 255.0 * r )); 57 | int G = (unsigned char) max( 0., min( 255.0, 255.0 * g )); 58 | int B = (unsigned char) max( 0., min( 255.0, 255.0 * b )); 59 | 60 | stringstream ss; 61 | ss << hex; 62 | 63 | ss << R << G << B; 64 | return ss.str(); 65 | } 66 | 67 | std::ostream& operator<<( std::ostream& os, const Color& c ) { 68 | os << "( r=" << c.r; 69 | os << ", g=" << c.g; 70 | os << ", b=" << c.b; 71 | os << ", a=" << c.a; 72 | os << " )" << endl; 73 | return os; 74 | } 75 | 76 | } // namespace CGL 77 | -------------------------------------------------------------------------------- /8/CGL/src/complex.cpp: -------------------------------------------------------------------------------- 1 | #include "complex.h" 2 | 3 | namespace CGL { 4 | 5 | std::ostream& operator<<( std::ostream& os, const Complex& z ) { 6 | if( z.y > 0 ) { 7 | os << z.x << " + " << z.y << "i"; 8 | } else if( z.y < 0 ) { 9 | os << z.x << " - " << -z.y << "i"; 10 | } else { 11 | os << z.x; 12 | } 13 | return os; 14 | } 15 | 16 | } // namespace CGL 17 | -------------------------------------------------------------------------------- /8/CGL/src/console.h: -------------------------------------------------------------------------------- 1 | #ifndef CGL_CONSOLE_H 2 | #define CGL_CONSOLE_H 3 | 4 | #include 5 | 6 | #define ANSI_RESET "\x1b[0m" 7 | #define ANSI_R "\x1b[31m" 8 | #define ANSI_G "\x1b[32m" 9 | #define ANSI_B "\x1b[34m" 10 | #define ANSI_C "\x1b[36m" 11 | #define ANSI_M "\x1b[35m" 12 | #define ANSI_Y "\x1b[33m" 13 | 14 | #define out_msg(s) std::cout << ANSI_B << "[CGL] " << ANSI_RESET << s << std::endl << std::flush 15 | #define out_wrn(s) std::cout << ANSI_Y << "[CGL] " << ANSI_RESET << s << std::endl << std::flush 16 | #define out_err(s) std::cout << ANSI_R << "[CGL] " << ANSI_RESET << s << std::endl << std::flush 17 | 18 | #endif // CGL_CONSOLE_H 19 | -------------------------------------------------------------------------------- /8/CGL/src/quaternion.cpp: -------------------------------------------------------------------------------- 1 | #include "quaternion.h" 2 | 3 | namespace CGL { 4 | 5 | std::ostream& operator<<( std::ostream& os, const Quaternion& v ) { 6 | os << "{ " << v.x << "i, " << v.y << "j, " << v.z << "k, " << v.w << " }"; 7 | return os; 8 | } 9 | 10 | } // namespace CGL 11 | -------------------------------------------------------------------------------- /8/CGL/src/vector2D.cpp: -------------------------------------------------------------------------------- 1 | #include "vector2D.h" 2 | 3 | namespace CGL { 4 | 5 | std::ostream& operator<<( std::ostream& os, const Vector2D& v ) { 6 | os << "( " << v.x << ", " << v.y << " )"; 7 | return os; 8 | } 9 | 10 | } // namespace CGL 11 | -------------------------------------------------------------------------------- /8/CGL/src/vector3D.cpp: -------------------------------------------------------------------------------- 1 | #include "vector3D.h" 2 | 3 | namespace CGL { 4 | 5 | std::ostream& operator<<( std::ostream& os, const Vector3D& v ) { 6 | os << "{ " << v.x << ", " << v.y << ", " << v.z << " }"; 7 | return os; 8 | } 9 | 10 | } // namespace CGL 11 | -------------------------------------------------------------------------------- /8/CGL/src/vector4D.cpp: -------------------------------------------------------------------------------- 1 | #include "vector4D.h" 2 | 3 | namespace CGL { 4 | 5 | std::ostream& operator<<( std::ostream& os, const Vector4D& v ) { 6 | os << "{ " << v.x << ", " << v.y << ", " << v.z << ", " << v.w << " }"; 7 | return os; 8 | } 9 | 10 | Vector3D Vector4D::to3D() 11 | { 12 | return Vector3D(x, y, z); 13 | } 14 | 15 | } // namespace CGL 16 | -------------------------------------------------------------------------------- /8/CGL/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_libraries(CGL) 2 | 3 | include_directories("${PROJECT_SOURCE_DIR}/src") 4 | 5 | link_libraries( 6 | glfw ${GLFW_LIBRARIES} 7 | glew ${GLEW_LIBRARIES} 8 | ${OPENGL_LIBRARIES} 9 | ${FREETYPE_LIBRARIES} 10 | ) 11 | 12 | # OSD 13 | add_executable(osd osd.cpp) 14 | 15 | # Install tests 16 | install(TARGETS osd DESTINATION bin/tests) 17 | -------------------------------------------------------------------------------- /8/readme.md: -------------------------------------------------------------------------------- 1 | # Assignment 8 2 | 3 | ## Task: 4 | 5 | Mass-Spring System, a Rope Simulator. 6 | 7 | PPT: 21-22 8 | 9 | ## Recall: 10 | 11 | 1. Animation 12 | 1. Particle System 13 | 2. Forward Kinematics 14 | 3. Inverse Kinematics 15 | 4. Rigging 16 | 5. Motion Capture 17 | 2. Physical Simulation 18 | 1. F=ma 19 | 3. Mass-Spring System 20 | 1. Ideal, zero length. $f_{a->b} = k_s(b-a)$ . 21 | 2. Non-zero. $f_{a \to b}=k_s \frac {b-a}{||b-a||}(||b-a||-l)$ 22 | 3. $f_b=-k_d\frac {b-a}{||b-a||}(b'-a') * \frac {b-a}{||b-a||}$ 23 | 4. Single Particle Simulation 24 | 1. Explicit Euler Method 25 | 1. x1 = x0 + delta_t * v, unstable 26 | 2. Some Methods to Combat Instability 27 | 5. Rigid Body Simulation 28 | 1. Similar to simulation a particle 29 | 6. Fluid Simulation 30 | 1. Position-Based Method: Gradient Descent 31 | 2. Eulerian vs. Lagrangian 32 | 3. Material Point Method (MPM) 33 | 34 | 35 | 36 | ## Code: 37 | 38 | -------------------------------------------------------------------------------- /8/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | # Application source 4 | set(APPLICATION_SOURCE 5 | rope.cpp 6 | application.cpp 7 | main.cpp 8 | ) 9 | 10 | #------------------------------------------------------------------------------- 11 | # Set include directories 12 | #------------------------------------------------------------------------------- 13 | include_directories( 14 | ${GLEW_INCLUDE_DIRS} 15 | ${GLFW_INCLUDE_DIRS} 16 | ${CGL_INCLUDE_DIRS} 17 | ${FREETYPE_INCLUDE_DIRS} 18 | ) 19 | 20 | #------------------------------------------------------------------------------- 21 | # Set link directories 22 | #------------------------------------------------------------------------------- 23 | link_directories( 24 | ${GLEW_LIBRARY_DIRS} 25 | ${GLFW_LIBRARY_DIRS} 26 | ${CGL_LIBRARY_DIRS} 27 | ${FREETYPE_LIBRARY_DIRS} 28 | ) 29 | 30 | #------------------------------------------------------------------------------- 31 | # Add executable 32 | #------------------------------------------------------------------------------- 33 | add_executable(ropesim ${APPLICATION_SOURCE}) 34 | 35 | target_link_libraries( ropesim 36 | CGL ${CGL_LIBRARIES} 37 | glew ${GLEW_LIBRARIES} 38 | glfw ${GLFW_LIBRARIES} 39 | ${OPENGL_LIBRARIES} 40 | ${FREETYPE_LIBRARIES} 41 | ${CMAKE_THREADS_INIT} 42 | ) 43 | 44 | #------------------------------------------------------------------------------- 45 | # Platform-specific configurations for target 46 | #------------------------------------------------------------------------------- 47 | if(APPLE) 48 | set_property( TARGET ropesim APPEND_STRING PROPERTY COMPILE_FLAGS 49 | "-Wno-deprecated-declarations -Wno-c++11-extensions") 50 | endif(APPLE) 51 | 52 | # Put executable in build directory root 53 | set(EXECUTABLE_OUTPUT_PATH ..) 54 | 55 | # Install to project root 56 | install(TARGETS ropesim DESTINATION ${RopeSim_SOURCE_DIR}) 57 | -------------------------------------------------------------------------------- /8/src/application.h: -------------------------------------------------------------------------------- 1 | #ifndef CGL_APPLICATION_H 2 | #define CGL_APPLICATION_H 3 | 4 | // STL 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | // libCGL 12 | #include "CGL/CGL.h" 13 | #include "CGL/osdtext.h" 14 | #include "CGL/renderer.h" 15 | 16 | #include "rope.h" 17 | 18 | using namespace std; 19 | 20 | namespace CGL { 21 | 22 | struct AppConfig { 23 | AppConfig() { 24 | // Rope config variables 25 | mass = 1; 26 | ks = 100; 27 | 28 | // Environment variables 29 | gravity = Vector2D(0, -1); 30 | steps_per_frame = 64; 31 | } 32 | 33 | float mass; 34 | float ks; 35 | 36 | float steps_per_frame; 37 | Vector2D gravity; 38 | }; 39 | 40 | class Application : public Renderer { 41 | public: 42 | Application(AppConfig config); 43 | ~Application(); 44 | 45 | void init(); 46 | void render(); 47 | void resize(size_t w, size_t h); 48 | 49 | std::string name(); 50 | std::string info(); 51 | 52 | void keyboard_event(int key, int event, unsigned char mods); 53 | // void cursor_event(float x, float y); 54 | // void scroll_event(float offset_x, float offset_y); 55 | // void mouse_event(int key, int event, unsigned char mods); 56 | 57 | private: 58 | AppConfig config; 59 | 60 | Rope *ropeEuler; 61 | Rope *ropeVerlet; 62 | 63 | size_t screen_width; 64 | size_t screen_height; 65 | 66 | }; // class Application 67 | 68 | } // namespace CGL 69 | 70 | #endif // CGL_APPLICATION_H 71 | -------------------------------------------------------------------------------- /8/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "CGL/CGL.h" 2 | #include "CGL/viewer.h" 3 | 4 | #include "application.h" 5 | typedef uint32_t gid_t; 6 | 7 | #include 8 | #include 9 | 10 | using namespace std; 11 | using namespace CGL; 12 | 13 | void usage(const char *binaryName) { 14 | printf("Usage: %s [options] \n", binaryName); 15 | printf("Program Options:\n"); 16 | printf(" -m Mass per node\n"); 17 | printf(" -g Gravity vector (x, y)\n"); 18 | printf(" -s Number of steps per simulation frame\n"); 19 | printf("\n"); 20 | } 21 | 22 | int main(int argc, char **argv) { 23 | AppConfig config; 24 | int opt; 25 | 26 | while ((opt = getopt(argc, argv, "s:l:t:m:e:h:f:r:c:a:p:")) != -1) { 27 | switch (opt) { 28 | case 'm': 29 | config.mass = atof(optarg); 30 | break; 31 | case 'g': 32 | config.gravity = Vector2D(atof(argv[optind - 1]), atof(argv[optind])); 33 | optind++; 34 | break; 35 | case 's': 36 | config.steps_per_frame = atoi(optarg); 37 | break; 38 | default: 39 | usage(argv[0]); 40 | return 1; 41 | } 42 | } 43 | 44 | // create application 45 | Application *app = new Application(config); 46 | 47 | // create viewer 48 | Viewer viewer = Viewer(); 49 | 50 | // set renderer 51 | viewer.set_renderer(app); 52 | 53 | // init viewer 54 | viewer.init(); 55 | 56 | // start viewer 57 | viewer.start(); 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /8/src/mass.h: -------------------------------------------------------------------------------- 1 | #ifndef MASS_H 2 | #define MASS_H 3 | 4 | #include "CGL/CGL.h" 5 | #include "CGL/vector2D.h" 6 | 7 | using namespace CGL; 8 | 9 | struct Mass { 10 | Mass(Vector2D position, float mass, bool pinned) 11 | : start_position(position), position(position), last_position(position), 12 | mass(mass), pinned(pinned) {} 13 | 14 | float mass; 15 | bool pinned; 16 | 17 | Vector2D start_position; 18 | Vector2D position; 19 | 20 | // explicit Verlet integration 21 | 22 | Vector2D last_position; 23 | 24 | // explicit Euler integration 25 | 26 | Vector2D velocity; 27 | Vector2D forces; 28 | }; 29 | 30 | #endif /* MASS_H */ 31 | -------------------------------------------------------------------------------- /8/src/rope.h: -------------------------------------------------------------------------------- 1 | #ifndef ROPE_H 2 | #define ROPE_H 3 | 4 | #include "CGL/CGL.h" 5 | #include "mass.h" 6 | #include "spring.h" 7 | 8 | using namespace std; 9 | 10 | namespace CGL { 11 | 12 | class Rope { 13 | public: 14 | Rope(vector &masses, vector &springs) 15 | : masses(masses), springs(springs) {} 16 | Rope(Vector2D start, Vector2D end, int num_nodes, float node_mass, float k, 17 | vector pinned_nodes); 18 | 19 | void simulateVerlet(float delta_t, Vector2D gravity); 20 | void simulateEuler(float delta_t, Vector2D gravity); 21 | 22 | vector masses; 23 | vector springs; 24 | }; // struct Rope 25 | } 26 | #endif /* ROPE_H */ 27 | -------------------------------------------------------------------------------- /8/src/spring.h: -------------------------------------------------------------------------------- 1 | #ifndef SPRING_H 2 | #define SPRING_H 3 | 4 | #include "CGL/CGL.h" 5 | #include "mass.h" 6 | 7 | using namespace std; 8 | 9 | namespace CGL { 10 | 11 | struct Spring { 12 | Spring(Mass *a, Mass *b, float k) 13 | : m1(a), m2(b), k(k), rest_length((a->position - b->position).norm()) {} 14 | 15 | float k; 16 | double rest_length; 17 | 18 | Mass *m1; 19 | Mass *m2; 20 | }; // struct Spring 21 | } 22 | #endif /* SPRING_H */ 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GAMES101_Assignment 2 | 3 | Current assignment progress: 8/8 4 | 5 | Mainpage: https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html 6 | 7 | Video: https://www.bilibili.com/video/av90798049 8 | 9 | Assignment: http://games-cn.org/forums/topic/allhw/ 10 | 11 | BBS: http://games-cn.org/forums/forum/graphics-intro/ 12 | --------------------------------------------------------------------------------