Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/nextest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Rust Tests (nextest)

on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]

jobs:
test:
name: Run cargo nextest
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run tests
run: cargo test
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

target/
Cargo.lock

# Added by cargo

/target
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "matrix"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
25 changes: 25 additions & 0 deletions matrix_display/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Projection Matrix Display

This software is intended to provide a way to check that a 3D projection matrix is valid.

To perform the test, place the matrix into a file called `proj`. Example:

```
1.0, 0.0, 0.0, 0.0
0.0, 1.0, 0.0, 0.0
0.0, 0.0, 1.0, 0.0
0.0, 0.0, 0.0, 1.0
```

(The above matrix will not work properly for a 3D projection but its format is correct)

If the matrix is correct, the display will show a 3D projection of the 42AI organization's logo.

## Controls

- **Esc**: Quit the program
- **Arrow Up**/**W**: Move forward
- **Arrow Down**/**S**: Move backward
- **Arrow Left**/**A**: Move left
- **Arrow Right**/**D**: Move right
- **Mouse**: Look around
Binary file added matrix_display/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
180 changes: 180 additions & 0 deletions matrix_display/assets/model.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Blender v2.91.2 OBJ File: '42ai_3d.blend'
# www.blender.org
mtllib 42ai_3d.mtl
o Shape
v -0.456377 -0.177362 0.100000
v -0.130392 0.386972 0.100000
v 0.195574 -0.177362 0.100000
v 0.064101 -0.177362 0.100000
v 0.000605 -0.064495 0.100000
v -0.000578 -0.064495 0.100000
v -0.130392 0.161238 0.100000
v -0.260225 -0.064495 0.100000
v -0.130640 -0.064495 0.100000
v -0.065714 -0.177362 0.100000
v -0.000807 0.386972 0.100000
v 0.131850 0.386972 0.100000
v 0.456404 -0.177362 0.100000
v 0.326590 -0.177362 0.100000
v -0.456377 -0.177362 -0.100000
v -0.130392 0.386972 -0.100000
v 0.195574 -0.177362 -0.100000
v 0.064101 -0.177362 -0.100000
v 0.000605 -0.064495 -0.100000
v -0.000578 -0.064495 -0.100000
v -0.130392 0.161238 -0.100000
v -0.260225 -0.064495 -0.100000
v -0.130640 -0.064495 -0.100000
v -0.065714 -0.177362 -0.100000
v -0.000807 0.386972 -0.100000
v 0.131850 0.386972 -0.100000
v 0.456404 -0.177362 -0.100000
v 0.326590 -0.177362 -0.100000
v -0.456377 -0.177362 -0.100000
v -0.456377 -0.177362 0.100000
v -0.130392 0.386972 -0.100000
v -0.130392 0.386972 0.100000
v 0.195574 -0.177362 -0.100000
v 0.195574 -0.177362 0.100000
v 0.064101 -0.177362 -0.100000
v 0.064101 -0.177362 0.100000
v 0.000605 -0.064495 -0.100000
v 0.000605 -0.064495 0.100000
v -0.000578 -0.064495 -0.100000
v -0.000578 -0.064495 0.100000
v -0.130392 0.161238 -0.100000
v -0.130392 0.161238 0.100000
v -0.260225 -0.064495 -0.100000
v -0.260225 -0.064495 0.100000
v -0.130640 -0.064495 -0.100000
v -0.130640 -0.064495 0.100000
v -0.065714 -0.177362 -0.100000
v -0.065714 -0.177362 0.100000
v -0.000807 0.386972 -0.100000
v -0.000807 0.386972 0.100000
v 0.131850 0.386972 -0.100000
v 0.131850 0.386972 0.100000
v 0.456404 -0.177362 -0.100000
v 0.456404 -0.177362 0.100000
v 0.326590 -0.177362 -0.100000
v 0.326590 -0.177362 0.100000
vt 0.421665 0.073017
vt 0.522635 0.102115
vt 0.547876 0.145815
vt 0.547876 0.000116
vt 0.447360 0.438080
vt 0.421665 0.306888
vt 0.447360 0.291982
vt 0.422215 0.452668
vt 0.472259 0.072934
vt 0.521736 0.044355
vt 0.522753 0.043768
vt 0.497345 0.058444
vt 0.497293 0.029334
vt 0.522424 0.014818
vt 0.522632 0.248050
vt 0.547874 0.146048
vt 0.547874 0.291749
vt 0.421665 0.218952
vt 0.447592 0.437761
vt 0.473287 0.306569
vt 0.473287 0.452668
vt 0.448142 0.291982
vt 0.522523 0.189832
vt 0.472030 0.218999
vt 0.472658 0.218189
vt 0.497437 0.204323
vt 0.472247 0.189734
vt 0.447116 0.204250
vt 0.076240 0.346088
vt 0.026836 0.999884
vt 0.000116 0.401267
vt 0.195839 0.239879
vt 0.119146 0.886700
vt 0.199779 0.122423
vt 0.218708 0.854732
vt 0.218708 0.000116
vt 0.190671 0.867320
vt 0.144083 0.110395
vt 0.163261 0.874117
vt 0.154549 0.213758
vt 0.121602 0.878203
vt 0.142716 0.293683
vt 0.108497 0.899797
vt 0.077107 0.348728
vt 0.072698 0.945142
vt 0.005764 0.389783
vt 0.038953 0.954045
vt 0.011123 0.962618
vt 0.410801 0.093210
vt 0.372929 0.429435
vt 0.421432 0.095882
vt 0.218941 0.332922
vt 0.421432 0.428236
vt 0.228947 0.335425
vt 0.268290 0.000116
vt 0.221375 0.000820
vn -0.0000 0.0000 1.0000
vn 0.0000 -0.0000 -1.0000
vn 0.0000 1.0000 0.0000
vn -0.8661 -0.4999 0.0000
vn 0.8661 -0.4999 0.0000
vn -0.5048 -0.8632 0.0000
vn -0.5007 -0.8656 0.0000
vn -0.0000 -1.0000 0.0000
vn 0.8656 0.5007 0.0000
vn 0.5007 0.8656 0.0000
vn 0.8656 -0.5007 0.0000
vn -0.8665 0.4991 0.0000
vn -0.4991 -0.8665 0.0000
usemtl SVGMat.002
s off
f 1/1/1 7/2/1 2/3/1
f 7/2/1 3/4/1 2/3/1
f 14/5/1 12/6/1 11/7/1
f 14/5/1 13/8/1 12/6/1
f 1/1/1 8/9/1 7/2/1
f 6/10/1 5/11/1 7/2/1
f 5/11/1 3/4/1 7/2/1
f 1/1/1 9/12/1 8/9/1
f 1/1/1 10/13/1 9/12/1
f 4/14/1 3/4/1 5/11/1
f 21/15/2 15/16/2 16/17/2
f 17/18/2 21/15/2 16/17/2
f 26/19/2 28/20/2 25/21/2
f 27/22/2 28/20/2 26/19/2
f 22/23/2 15/16/2 21/15/2
f 19/24/2 20/25/2 21/15/2
f 17/18/2 19/24/2 21/15/2
f 23/26/2 15/16/2 22/23/2
f 24/27/2 15/16/2 23/26/2
f 17/18/2 18/28/2 19/24/2
s 1
f 32/29/3 29/30/4 30/31/4
f 34/32/5 31/33/3 32/29/3
f 36/34/6 33/35/5 34/32/5
f 38/36/6 35/37/6 36/34/6
f 40/38/7 37/39/6 38/36/6
f 42/40/8 39/41/7 40/38/7
f 44/42/9 41/43/8 42/40/8
f 46/44/10 43/45/9 44/42/9
f 48/46/11 45/47/10 46/44/10
f 30/31/4 47/48/11 48/46/11
f 52/49/10 49/50/12 50/51/12
f 54/52/11 51/53/10 52/49/10
f 56/54/13 53/55/11 54/52/11
f 50/51/12 55/56/13 56/54/13
f 32/29/3 31/33/3 29/30/4
f 34/32/5 33/35/5 31/33/3
f 36/34/6 35/37/6 33/35/5
f 38/36/6 37/39/6 35/37/6
f 40/38/7 39/41/7 37/39/6
f 42/40/8 41/43/8 39/41/7
f 44/42/9 43/45/9 41/43/8
f 46/44/10 45/47/10 43/45/9
f 48/46/11 47/48/11 45/47/10
f 30/31/4 29/30/4 47/48/11
f 52/49/10 51/53/10 49/50/12
f 54/52/11 53/55/11 51/53/10
f 56/54/13 55/56/13 53/55/11
f 50/51/12 49/50/12 55/56/13
Binary file added matrix_display/display
Binary file not shown.
4 changes: 4 additions & 0 deletions matrix_display/proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3.7808547, 0, 0, 0
0, 5.671282, 0, 0
0, 0, -1.0833334, -4.1666665
0, 0, -1, 0
2 changes: 2 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
max_width = 80
hard_tabs = false
Loading
Loading