Skip to content

A raylib demo to visualize the Model, View, and Projection (MVP) matrices.

License

Notifications You must be signed in to change notification settings

jdeokkim/mvp-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MVP Transform Visualizer

"The engines don’t move the ship at all.

The ship stays where it is and the engines move the universe around it."

— Futurama

A raylib demo to visualize the Model, View, and Projection (MVP) matrices.

This project is a C rewrite of @diskhkme's MVP Transform Visualizer with additional features, for the "Computer Graphics" (1214-3005) course at Chungnam National University.

mvp-demo-v0.1.0.mp4

Controls

  • ALT + 0: Draw All Spaces
  • ALT + 1: Draw Local Space
  • ALT + 2: Draw World Space
  • ALT + 3: Draw View Space
  • ALT + 4: Draw Clip Space
  • ESC: Lock/Unlock Observer Camera
  • V: Show/Hide Player Model Vertices

Prerequisites

  • GCC version 11.4.0+
  • Git version 2.34.0+
  • GNU Make version 4.3+
  • raylib 5.0+

Building

Compiling for Windows

Download the latest release of w64devkit from here, extract the .zip file to your working directory, and run w64devkit.exe.

$ cd .. && wget https://github.com/raysan5/raylib/archive/refs/tags/5.0.zip
$ unzip 5.0.zip && mv raylib-5.0 raylib
$ cd raylib/src && make
$ git clone https://github.com/jdeokkim/mvp-demo
$ cd mvp-demo && make -f Makefile.mingw
Compiling for GNU/Linux

Debian / Ubuntu

$ sudo apt update && sudo apt install libasound2-dev libgl1-mesa-dev \
  libglu1-mesa-dev libx11-dev libxrandr-dev libxi-dev libxcursor-dev \
  libxinerama-dev libxkbcommon-dev
$ git clone https://github.com/raysan5/raylib ~/raylib && cd ~/raylib/src
$ make PLATFORM=PLATFORM_DESKTOP GLFW_LINUX_ENABLE_WAYLAND=OFF && make install
$ git clone https://github.com/jdeokkim/mvp-demo
$ cd mvp-demo && make
Cross-compiling from GNU/Linux to Windows (WSL2)

Debian / Ubuntu

$ sudo apt install mingw-w64
$ git clone https://github.com/raysan5/raylib && cd raylib/src
$ make CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar OS=Windows_NT
$ git clone https://github.com/jdeokkim/mvp-demo
$ cd mvp-demo && make -f Makefile.mingw

License

MIT License

Copyright (c) 2024 Jaedeok Kim <jdeokkim@protonmail.com>
Copyright (c) 2024 Minhu Lee <fghkk12d@gmail.com>

Copyright (c) 2024 Hyungki Kim <diskhkme@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.