A simple 3D model viewer built with OpenGL.
git submodule init && git submodule update --recursive
NOTE: make sure clang --version
is >= 3.5 if you want compile_commands.json
generation, this is useful in case you're working with VSCode; LSP config comes free.
I've been testing this on a Windows machine using Visual Studio 2022 Community Edition. Please ensure the following:
-
Install a version of C++ Build Tools via the Visual Studio Installer.
-
Ensure
MSBuild.exe
is listed in your WindowsPath
environment variable. -
Add the following directory to your
Path
environment variable to prevent crashes:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64
This prevents the
modelview.exe
from crashing on startup due to missingclang_rt.asan_dbg_dynamic-x86_64.dll
andclang_rt.asan_dynamic-x86_64.dll
. -
OpenGL must be installed on your system:
- Install Mesa using MSYS pacman:
pacman -S mingw64/mingw-w64-x86_64-mesa
- Alternatively, you can follow the official Khronos guide, but using MSYS pacman is easier.
- Install Mesa using MSYS pacman:
Both Linux and macOS share similar setup steps. Here's what you need to do:
- Install OpenGL:
-
Linux: Use your package manager to install the OpenGL libraries:
sudo apt-get install libgl1-mesa-dev
Or, if using Arch Linux:
sudo pacman -S mesa
-
macOS: OpenGL should already be installed by default. If you need to ensure you have the latest version, you can use Homebrew:
brew install mesa
-
Use the appropriate compile script for your platform. The script will generate a debug-compatible executable.
-
Linux/macOS:
./compile.sh
-
Windows:
.\compile.bat
File Format | Supported | Platform | Supported |
---|---|---|---|
.obj | Yes | Linux | Yes |
.gltf | No | macOS | No |
.fbx | No | Win32 | No |