Skip to content

rbourgeat/scop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scop

Basic 3D model viewer made with Vulkan, C++ and GLFW.

tifa.obj

teapot.obj

Pre-requisites

Install Vulkan from source.

Linux:

sudo apt-get install -y libglfw3 libglfw3-dev libxxf86vm-dev libxi-dev
# For debug:
sudo apt-get install -y libvulkan-dev vulkan-validationlayers

Macos:

brew install glfw

export DYLD_LIBRARY_PATH=/Users/$USER/VulkanSDK/$(ls -1 "/Users/$USER/VulkanSDK" | sort -V | tail -n 1)/macOS/lib/:$DYLD_LIBRARY_PATH

Build

Normal:

  • Using make
make
  • Using cmake
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=<Debug|Release> .. # use Debug to enable debug mode

# Use your generator (most likely, ninja or make)
# if make:
make
# if ninja:
ninja

Re-build:

make re

Build in debug mode:

make debug

Run

./scop "path/to/file.obj"

Inputs

  • MOUSE : rotate 3D object

  • SPACE : reset object position/rotation + camera

  • R, G, B, D, 0 : color in red, green, blue, dark or black (like the subject)

  • T : change topology

  • 1, 2, 3 : increase X, Y, Z model position

  • SHIFT + 1, 2, 3 : decrease X, Y, Z model position

  • 4, 5, 6 : increase X, Y, Z model rotation

  • SHIFT + 4, 5, 6 : decrease X, Y, Z model rotation

  • M : toggles usage of a texture with a little transition

  • N : reset color

Sources

ToDo List