-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
464 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
|
||
# 설정 파일 | ||
*.manifest | ||
**/bin/ | ||
**/.vs/ | ||
**/.vscode/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# | ||
# Copyright (c) 2024 Jaedeok Kim <jdeokkim@protonmail.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. | ||
# | ||
|
||
# ============================================================================= | ||
|
||
.PHONY: all clean rebuild | ||
|
||
# ============================================================================= | ||
|
||
# TODO: Edit these values to match your raylib installation path! | ||
RAYLIB_INCLUDE_PATH = ../raylib/src | ||
RAYLIB_LIBRARY_PATH = ../raylib/src | ||
|
||
BINARY_PATH = bin | ||
INCLUDE_PATH = include | ||
LIBRARY_PATH = lib | ||
RESOURCE_PATH = res | ||
SOURCE_PATH = src | ||
|
||
TARGET_SUFFIX = html | ||
|
||
# ============================================================================= | ||
|
||
CC = emcc | ||
CFLAGS = -D_DEFAULT_SOURCE -DPLATFORM_WEB -g -I${INCLUDE_PATH} \ | ||
-I${RAYLIB_INCLUDE_PATH} -I${INCLUDE_PATH}/raygui -I${RESOURCE_PATH} \ | ||
-O2 -std=gnu99 | ||
LDFLAGS = -L${RAYLIB_LIBRARY_PATH} | ||
LDLIBS = -lraylib -ldl -lGL -lm -lpthread -lrt -lX11 | ||
WEBFLAGS = -s FORCE_FILESYSTEM -s FULL_ES3 -s INITIAL_MEMORY=67108864 \ | ||
-s USE_GLFW=3 --preload-file ${RESOURCE_PATH} \ | ||
--shell-file ${RESOURCE_PATH}/html/shell.html | ||
|
||
CFLAGS += -Wno-limited-postlink-optimizations | ||
|
||
# ============================================================================= | ||
|
||
all clean rebuild: | ||
@${MAKE} TARGET_SUFFIX=${TARGET_SUFFIX} CC=${CC} CFLAGS="${CFLAGS}" \ | ||
LDFLAGS="${LDFLAGS}" LDLIBS="${LDLIBS}" WEBFLAGS="${WEBFLAGS}" $@ | ||
|
||
# ============================================================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,149 @@ | ||
# 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](https://github.com/raysan5/raylib) demo to visualize the Model, View, and Projection (MVP) matrices. | ||
|
||
This project is a C rewrite of [@diskhkme](https://github.com/diskhkme)'s [MVP Transform Visualizer](https://github.com/diskhkme/mvp_transform_visualize) with additional features, for the "Computer Graphics" (1214-3005) course at Chungnam National University. | ||
|
||
https://github.com/user-attachments/assets/4b7cda17-2f32-4651-9297-7070fb274da0 | ||
|
||
## 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 | ||
|
||
<details> | ||
<summary>Compiling for Windows</summary> | ||
|
||
### [w64devkit](https://github.com/skeeto/w64devkit) | ||
|
||
Download the latest release of w64devkit from [here](https://github.com/skeeto/w64devkit/releases), extract the `.zip` file to your working directory, and run `w64devkit.exe`. | ||
|
||
```console | ||
$ 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 | ||
``` | ||
|
||
```console | ||
$ git clone https://github.com/jdeokkim/mvp-demo | ||
$ cd mvp-demo && make -f Makefile.mingw | ||
``` | ||
|
||
</details> | ||
|
||
<details> | ||
<summary>Compiling for GNU/Linux</summary> | ||
|
||
### Debian / Ubuntu | ||
|
||
```console | ||
$ 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 | ||
``` | ||
|
||
```console | ||
$ git clone https://github.com/jdeokkim/mvp-demo | ||
$ cd mvp-demo && make | ||
``` | ||
|
||
</details> | ||
|
||
<details> | ||
<summary>Cross-compiling from GNU/Linux to Windows (WSL2)</summary> | ||
|
||
### Debian / Ubuntu | ||
|
||
```console | ||
$ 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 | ||
``` | ||
|
||
```console | ||
$ git clone https://github.com/jdeokkim/mvp-demo | ||
$ cd mvp-demo && make -f Makefile.mingw | ||
``` | ||
|
||
</details> | ||
|
||
## 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. | ||
``` | ||
# 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](https://github.com/raysan5/raylib) demo to visualize the Model, View, and Projection (MVP) matrices. | ||
|
||
This project is a C rewrite of [@diskhkme](https://github.com/diskhkme)'s [MVP Transform Visualizer](https://github.com/diskhkme/mvp_transform_visualize) with additional features, for the "Computer Graphics" (1214-3005) course at Chungnam National University. | ||
|
||
https://github.com/user-attachments/assets/4b7cda17-2f32-4651-9297-7070fb274da0 | ||
|
||
## 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.5+ | ||
|
||
## Building | ||
|
||
<details> | ||
<summary>Compiling for Windows</summary> | ||
|
||
### [w64devkit](https://github.com/skeeto/w64devkit) | ||
|
||
Download the latest release of w64devkit from [here](https://github.com/skeeto/w64devkit/releases), extract the `.zip` file to your working directory, and run `w64devkit.exe`. | ||
|
||
```console | ||
$ 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 | ||
``` | ||
|
||
```console | ||
$ git clone https://github.com/jdeokkim/mvp-demo | ||
$ cd mvp-demo && make -f Makefile.mingw | ||
``` | ||
|
||
</details> | ||
|
||
<details> | ||
<summary>Compiling for GNU/Linux</summary> | ||
|
||
### Debian / Ubuntu | ||
|
||
```console | ||
$ 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 | ||
``` | ||
|
||
```console | ||
$ git clone https://github.com/jdeokkim/mvp-demo | ||
$ cd mvp-demo && make | ||
``` | ||
|
||
</details> | ||
|
||
<details> | ||
<summary>Compiling for the Web (LLVM-to-WebAssembly)</summary> | ||
|
||
### Debian / Ubuntu | ||
|
||
Compiling for the Web requires installation of the [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html). | ||
|
||
```console | ||
$ git clone git clone https://github.com/emscripten-core/emsdk && cd emsdk | ||
$ ./emsdk install latest | ||
$ ./emsdk activate latest | ||
$ source ./emsdk_env.sh | ||
``` | ||
|
||
Then, you must recompile raylib for the Web: | ||
|
||
```console | ||
$ git clone https://github.com/raysan5/raylib && cd raylib/src | ||
$ make -j`nproc` PLATFORM=PLATFORM_WEB GRAPHICS=GRAPHICS_API_OPENGL_ES3 -B | ||
``` | ||
|
||
Finally, in order to build this project, do: | ||
|
||
``` | ||
$ git clone https://github.com/jdeokkim/mvp-demo | ||
$ cd mvp-demo && make -f Makefile.emcc | ||
``` | ||
|
||
</details> | ||
|
||
<details> | ||
<summary>Cross-compiling from GNU/Linux to Windows (WSL2)</summary> | ||
|
||
### Debian / Ubuntu | ||
|
||
```console | ||
$ 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 | ||
``` | ||
|
||
```console | ||
$ git clone https://github.com/jdeokkim/mvp-demo | ||
$ cd mvp-demo && make -f Makefile.mingw | ||
``` | ||
|
||
</details> | ||
|
||
## 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. | ||
``` |
Oops, something went wrong.