Skip to content

drohmer/inf443_practice_code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Practice code for INF443 - 3D Graphics

Download

Note: Do not use the "Code -> Download ZIP" option from the GitHub GUI as you won't get the CGP library as submodule with the code.

Clone

git clone --recurse-submodules https://github.com/drohmer/inf443_practice_code.git

or

git clone https://github.com/drohmer/inf443_practice_code.git
cd inf443_practice_code/
git submodule init
git submodule update

Compilation

Scenes are in a directory scenes_inf443/xx_Name/

Each scene is provided with its own CMakeLists.txt and Makefile

Compilation via CMake

cd scenes_inf443/01_introduction/
cmake -B build/
cd build/
make -j8 # or any -jN, with N=$(nproc)
./01_introduction

Compilation via Makefile

cd scenes_inf443/01_introduction/
make -j8 # or any -jN, with N=$(nproc)
./01_introduction

More details are provided in the dedicated Installation setup and Compilation page if needed (Windows, Linux, Mac).

Requirement

The code requires the GLFW library in Linux.

Linux (/Ubuntu)

sudo apt-get install libglfw3-dev

MacOS:

  • You may use brew to install glfw. And then add the following two lines on your .zshrc to add glfw library to the path
export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib
  • Alternatively, a pre-compiled glfw can be used without installation. To activate it, open the CMakeLists.txt file and set the option MACOS_GLFW_PRECOMPILED to ON. You may need to explicitely allow the mac to use the library if security triggers an alert.

Windows:

The simplest way is the use of Visual Studio with the scripts/windows_cmake_visual.bat generating a visual studio project.

IDE

The full edition/compilation/debug toolchain should work with the following IDE:

  • Visual Studio Code/vscode on Linux and MacOS: You may open a project with the dedicated configuration file vscode.code-workspace.
  • Visual Studio on Windows only. Free for individuals.
  • CLion on any plateform (you need to install a compiler on Windows). Note that as student you are elligible for a free licence to this IDE. A project can be loaded directly from the CMakeLists.txt.
  • QtCreator on Linux and MacOS. Install it via your package manager (apt/brew). A project can be loaded directly from the CMakeLists.txt (you may have to indicate to build in RelWithDebInfo instead of the default Debug).

Scripts

You may use the provided scripts (in directory scripts/) and configuration files to ease some of the compilation process

  • vscode.code-workspace: workspace configuration file for Visual Code Studio (vscode).
  • scripts/linux_compile_run_cmake.py: Run CMake, compile and run the code on Linux and MacOS. linux_clean.py remove temporary files.
  • scripts/windows_cmake_visual.bat: On Windows, call CMake and generate a Visual Studio project. CMake must be accessible on the command line path. scripts/windows_clean.bat remove the temporary files and the visual studio project.
  • scripts/linux_compile_emscripten.py: Generate a webpage runing the code of the scene. The script can run on Linux and MacOS if emscripten is installed.

Links

About

Code for INF443 practice class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors