diff --git a/simul/.gitignore b/simul/.gitignore deleted file mode 100644 index 2f7896d..0000000 --- a/simul/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target/ diff --git a/simul/.vscode/launch.json b/simul/.vscode/launch.json deleted file mode 100644 index 5ddde67..0000000 --- a/simul/.vscode/launch.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Debug executable 'simul'", - "type": "lldb", - "request": "launch", - "cargo": { - "args": [ - "run", - "--bin=simul" - ] - }, - "args": [] - }, - { - "name": "Debug unit tests in executable 'simul'", - "type": "lldb", - "request": "launch", - "cargo": { - "args": [ - "test", - "--bin=simul" - ] - } - } - ] -} \ No newline at end of file diff --git a/simul/Cargo.lock b/simul/Cargo.lock deleted file mode 100644 index 6f969ad..0000000 --- a/simul/Cargo.lock +++ /dev/null @@ -1,198 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "bitflags" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" - -[[package]] -name = "csv" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938" -dependencies = [ - "csv-core", - "itoa", - "ryu", - "serde_core", -] - -[[package]] -name = "csv-core" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782" -dependencies = [ - "memchr", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.184" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" - -[[package]] -name = "memchr" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "obj-rs" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8247fd8f66340ad9c969f96e63a80a2f74b04e5403d92584b75e046006f4c7e1" -dependencies = [ - "num-traits", - "serde", -] - -[[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "sdl3" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce0693cede7f7901e968e5539f87174d0fb5fac5d489a3e3be52b2b4a0b49c5" -dependencies = [ - "bitflags", - "lazy_static", - "libc", - "sdl3-image-sys", - "sdl3-sys", - "sdl3-ttf-sys", -] - -[[package]] -name = "sdl3-image-sys" -version = "0.6.1+SDL-image-3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61a8cc9c72e2cab2e500752f513f65043ff1d36f994b90c7b423abcb796330d" -dependencies = [ - "sdl3-sys", -] - -[[package]] -name = "sdl3-sys" -version = "0.6.1+SDL-3.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d73fc820b0b6b9bd0557de7b799ec9da1ca4f35fcd1cb42f7ceb85e640d1477" - -[[package]] -name = "sdl3-ttf-sys" -version = "0.6.0+SDL-ttf-3.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c30da3dcd7e062f19350b47a532f7629c42801b801687535fd31e8ba2adfd71d" -dependencies = [ - "sdl3-sys", -] - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "simul" -version = "0.1.0" -dependencies = [ - "csv", - "obj-rs", - "sdl3", - "serde", -] - -[[package]] -name = "syn" -version = "2.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" diff --git a/simul/Cargo.toml b/simul/Cargo.toml deleted file mode 100644 index f3129e6..0000000 --- a/simul/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "simul" -version = "0.1.0" -edition = "2024" - -[dependencies] -csv = "1.4.0" -obj-rs = "0.7.4" -sdl3 = { version = "0.17.3", features = ["ttf", "image"] } -serde = { version = "1.0.228", features = ["derive"] } diff --git a/simul/assets/cube.mtl b/simul/assets/cube.mtl deleted file mode 100644 index 31c5ac7..0000000 --- a/simul/assets/cube.mtl +++ /dev/null @@ -1,12 +0,0 @@ -# Blender 5.1.0 MTL File: 'None' -# www.blender.org - -newmtl Material -Ns 250.000000 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.500000 0.500000 0.500000 -Ke 0.000000 0.000000 0.000000 -Ni 1.500000 -d 1.000000 -illum 2 diff --git a/simul/assets/cube.obj b/simul/assets/cube.obj deleted file mode 100644 index b9b58a5..0000000 --- a/simul/assets/cube.obj +++ /dev/null @@ -1,46 +0,0 @@ -# Blender 5.1.0 -# www.blender.org -mtllib cube.mtl -o Cube -v 1.000000 1.000000 -1.000000 -v 1.000000 -1.000000 -1.000000 -v 1.000000 1.000000 1.000000 -v 1.000000 -1.000000 1.000000 -v -1.000000 1.000000 -1.000000 -v -1.000000 -1.000000 -1.000000 -v -1.000000 1.000000 1.000000 -v -1.000000 -1.000000 1.000000 -vn -0.0000 1.0000 -0.0000 -vn -0.0000 -0.0000 1.0000 -vn -1.0000 -0.0000 -0.0000 -vn -0.0000 -1.0000 -0.0000 -vn 1.0000 -0.0000 -0.0000 -vn -0.0000 -0.0000 -1.0000 -vt 0.875000 0.500000 -vt 0.625000 0.750000 -vt 0.625000 0.500000 -vt 0.375000 1.000000 -vt 0.375000 0.750000 -vt 0.625000 0.000000 -vt 0.375000 0.250000 -vt 0.375000 0.000000 -vt 0.375000 0.500000 -vt 0.125000 0.750000 -vt 0.125000 0.500000 -vt 0.625000 0.250000 -vt 0.875000 0.750000 -vt 0.625000 1.000000 -s 0 -usemtl Material -f 5/1/1 3/2/1 1/3/1 -f 3/2/2 8/4/2 4/5/2 -f 7/6/3 6/7/3 8/8/3 -f 2/9/4 8/10/4 6/11/4 -f 1/3/5 4/5/5 2/9/5 -f 5/12/6 2/9/6 6/7/6 -f 5/1/1 7/13/1 3/2/1 -f 3/2/2 7/14/2 8/4/2 -f 7/6/3 5/12/3 6/7/3 -f 2/9/4 4/5/4 8/10/4 -f 1/3/5 3/2/5 4/5/5 -f 5/12/6 1/3/6 2/9/6 diff --git a/simul/assets/cube_and_sphere.mtl b/simul/assets/cube_and_sphere.mtl deleted file mode 100644 index 31c5ac7..0000000 --- a/simul/assets/cube_and_sphere.mtl +++ /dev/null @@ -1,12 +0,0 @@ -# Blender 5.1.0 MTL File: 'None' -# www.blender.org - -newmtl Material -Ns 250.000000 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.500000 0.500000 0.500000 -Ke 0.000000 0.000000 0.000000 -Ni 1.500000 -d 1.000000 -illum 2 diff --git a/simul/assets/cube_and_sphere.obj b/simul/assets/cube_and_sphere.obj deleted file mode 100644 index fb172cf..0000000 --- a/simul/assets/cube_and_sphere.obj +++ /dev/null @@ -1,333 +0,0 @@ -# Blender 5.1.0 -# www.blender.org -mtllib cube_and_sphere.mtl -o Cube -v 1.000000 1.000000 -1.000000 -v 1.000000 -1.000000 -1.000000 -v 1.000000 1.000000 1.000000 -v 1.000000 -1.000000 1.000000 -v -1.000000 1.000000 -1.000000 -v -1.000000 -1.000000 -1.000000 -v -1.000000 1.000000 1.000000 -v -1.000000 -1.000000 1.000000 -v 0.264812 2.047067 -0.748627 -v 0.264812 1.937980 -1.279160 -v 0.264812 1.232835 -1.809693 -v 0.264812 0.527690 -1.279160 -v 0.264812 0.418604 -0.748627 -v 0.630177 1.937980 -1.177837 -v 0.897643 1.639951 -1.492041 -v 0.995542 1.232835 -1.607047 -v 0.897643 0.825719 -1.492041 -v 0.630177 0.527690 -1.177837 -v 0.855985 1.937980 -0.912571 -v 1.288754 1.639951 -1.032586 -v 1.447159 1.232835 -1.076515 -v 1.288754 0.825719 -1.032586 -v 0.855985 0.527690 -0.912571 -v 0.855985 1.937980 -0.584684 -v 1.288754 1.639951 -0.464669 -v 1.447159 1.232835 -0.420740 -v 1.288754 0.825719 -0.464669 -v 0.855985 0.527690 -0.584684 -v 0.630177 1.937980 -0.319417 -v 0.897643 1.639951 -0.005214 -v 0.995543 1.232835 0.109793 -v 0.897643 0.825719 -0.005214 -v 0.630177 0.527690 -0.319417 -v 0.264812 1.937980 -0.218095 -v 0.264812 1.639951 0.170282 -v 0.264812 1.232835 0.312438 -v 0.264812 0.825719 0.170282 -v 0.264812 0.527690 -0.218095 -v -0.100553 1.937980 -0.319417 -v -0.368019 1.639951 -0.005214 -v -0.465918 1.232835 0.109793 -v -0.368019 0.825719 -0.005214 -v -0.100553 0.527690 -0.319417 -v -0.326361 1.937980 -0.584684 -v -0.759130 1.639951 -0.464669 -v -0.917534 1.232835 -0.420740 -v -0.759130 0.825719 -0.464669 -v -0.326361 0.527690 -0.584684 -v -0.326361 1.937980 -0.912571 -v -0.759130 1.639951 -1.032586 -v -0.917534 1.232835 -1.076515 -v -0.759130 0.825719 -1.032586 -v -0.326361 0.527690 -0.912571 -v -0.100553 1.937980 -1.177837 -v -0.368019 1.639951 -1.492041 -v -0.465918 1.232835 -1.607048 -v -0.368019 0.825719 -1.492041 -v -0.100553 0.527690 -1.177837 -v 0.264812 1.639951 -1.667537 -v 0.264812 0.825719 -1.667537 -vn -0.0000 1.0000 -0.0000 -vn -0.0000 -0.0000 1.0000 -vn -1.0000 -0.0000 -0.0000 -vn -0.0000 -1.0000 -0.0000 -vn 1.0000 -0.0000 -0.0000 -vn -0.0000 -0.0000 -1.0000 -vn 0.0558 -0.9780 -0.2011 -vn 0.2533 -0.3189 -0.9133 -vn 0.1665 0.7823 -0.6003 -vn 0.1665 -0.7823 -0.6003 -vn 0.2533 0.3189 -0.9133 -vn 0.0558 0.9780 -0.2011 -vn 0.4496 0.8070 -0.3828 -vn 0.4496 -0.8070 -0.3828 -vn 0.7150 0.3439 -0.6087 -vn 0.1465 0.9813 -0.1247 -vn 0.1465 -0.9813 -0.1247 -vn 0.7150 -0.3439 -0.6087 -vn 0.5672 -0.8236 -0.0000 -vn 0.9319 0.3626 -0.0000 -vn 0.1815 0.9834 -0.0000 -vn 0.1815 -0.9834 -0.0000 -vn 0.9319 -0.3626 -0.0000 -vn 0.5672 0.8236 -0.0000 -vn 0.4496 -0.8070 0.3828 -vn 0.7150 0.3439 0.6087 -vn 0.1465 0.9813 0.1247 -vn 0.1465 -0.9813 0.1247 -vn 0.7150 -0.3439 0.6087 -vn 0.4496 0.8070 0.3828 -vn 0.1665 -0.7823 0.6003 -vn 0.2533 0.3189 0.9133 -vn 0.0558 0.9780 0.2011 -vn 0.0558 -0.9780 0.2011 -vn 0.2533 -0.3189 0.9133 -vn 0.1665 0.7823 0.6003 -vn -0.1665 -0.7823 0.6003 -vn -0.2533 0.3189 0.9133 -vn -0.0558 0.9780 0.2011 -vn -0.0558 -0.9780 0.2011 -vn -0.2533 -0.3189 0.9133 -vn -0.1665 0.7823 0.6003 -vn -0.7150 0.3439 0.6087 -vn -0.1465 0.9813 0.1247 -vn -0.1465 -0.9813 0.1247 -vn -0.7150 -0.3439 0.6087 -vn -0.4496 0.8070 0.3828 -vn -0.4496 -0.8070 0.3828 -vn -0.1815 0.9834 -0.0000 -vn -0.1815 -0.9834 -0.0000 -vn -0.9319 -0.3626 -0.0000 -vn -0.5672 0.8236 -0.0000 -vn -0.5672 -0.8236 -0.0000 -vn -0.9319 0.3626 -0.0000 -vn -0.1465 -0.9813 -0.1247 -vn -0.7150 -0.3439 -0.6087 -vn -0.4496 0.8070 -0.3828 -vn -0.4496 -0.8070 -0.3828 -vn -0.7150 0.3439 -0.6087 -vn -0.1465 0.9813 -0.1247 -vn -0.0558 -0.9780 -0.2011 -vn -0.2533 -0.3189 -0.9133 -vn -0.1665 0.7823 -0.6003 -vn -0.1665 -0.7823 -0.6003 -vn -0.2533 0.3189 -0.9133 -vn -0.0558 0.9780 -0.2011 -vt 0.875000 0.500000 -vt 0.625000 0.750000 -vt 0.625000 0.500000 -vt 0.375000 1.000000 -vt 0.375000 0.750000 -vt 0.625000 0.000000 -vt 0.375000 0.250000 -vt 0.375000 0.000000 -vt 0.375000 0.500000 -vt 0.125000 0.750000 -vt 0.125000 0.500000 -vt 0.625000 0.250000 -vt 0.650000 0.000000 -vt 0.700000 0.166667 -vt 0.600000 0.166667 -vt 0.700000 0.500000 -vt 0.600000 0.333333 -vt 0.700000 0.333333 -vt 0.700000 0.666667 -vt 0.600000 0.833333 -vt 0.600000 0.666667 -vt 0.600000 0.500000 -vt 0.700000 0.833333 -vt 0.650000 1.000000 -vt 0.500000 0.833333 -vt 0.500000 0.666667 -vt 0.500000 0.166667 -vt 0.500000 0.500000 -vt 0.550000 1.000000 -vt 0.550000 0.000000 -vt 0.500000 0.333333 -vt 0.400000 0.166667 -vt 0.400000 0.500000 -vt 0.450000 1.000000 -vt 0.400000 0.833333 -vt 0.450000 0.000000 -vt 0.400000 0.333333 -vt 0.400000 0.666667 -vt 0.300000 0.333333 -vt 0.300000 0.166667 -vt 0.300000 0.500000 -vt 0.350000 1.000000 -vt 0.300000 0.833333 -vt 0.350000 0.000000 -vt 0.300000 0.666667 -vt 0.200000 0.333333 -vt 0.200000 0.166667 -vt 0.200000 0.500000 -vt 0.250000 1.000000 -vt 0.200000 0.833333 -vt 0.250000 0.000000 -vt 0.200000 0.666667 -vt 0.100000 0.166667 -vt 0.100000 0.666667 -vt 0.100000 0.500000 -vt 0.150000 1.000000 -vt 0.100000 0.833333 -vt 0.150000 0.000000 -vt 0.100000 0.333333 -vt 0.000000 0.666667 -vt 0.000000 0.500000 -vt 0.050000 1.000000 -vt 0.000000 0.833333 -vt 0.050000 0.000000 -vt 0.000000 0.166667 -vt 0.000000 0.333333 -vt 1.000000 0.833333 -vt 0.950000 1.000000 -vt 0.900000 0.833333 -vt 0.950000 0.000000 -vt 1.000000 0.166667 -vt 0.900000 0.166667 -vt 1.000000 0.500000 -vt 0.900000 0.333333 -vt 1.000000 0.333333 -vt 0.900000 0.666667 -vt 1.000000 0.666667 -vt 0.900000 0.500000 -vt 0.850000 0.000000 -vt 0.800000 0.166667 -vt 0.800000 0.500000 -vt 0.800000 0.333333 -vt 0.800000 0.666667 -vt 0.850000 1.000000 -vt 0.800000 0.833333 -vt 0.750000 0.000000 -vt 0.750000 1.000000 -vt 0.875000 0.750000 -vt 0.625000 1.000000 -s 0 -usemtl Material -f 5/1/1 3/2/1 1/3/1 -f 3/2/2 8/4/2 4/5/2 -f 7/6/3 6/7/3 8/8/3 -f 2/9/4 8/10/4 6/11/4 -f 1/3/5 4/5/5 2/9/5 -f 5/12/6 2/9/6 6/7/6 -f 13/13/7 12/14/7 18/15/7 -f 11/16/8 17/17/8 60/18/8 -f 59/19/9 14/20/9 15/21/9 -f 60/18/10 18/15/10 12/14/10 -f 11/16/11 15/21/11 16/22/11 -f 10/23/12 9/24/12 14/20/12 -f 15/21/13 19/25/13 20/26/13 -f 17/17/14 23/27/14 18/15/14 -f 16/22/15 20/26/15 21/28/15 -f 14/20/16 9/29/16 19/25/16 -f 13/30/17 18/15/17 23/27/17 -f 16/22/18 22/31/18 17/17/18 -f 22/31/19 28/32/19 23/27/19 -f 20/26/20 26/33/20 21/28/20 -f 19/25/21 9/34/21 24/35/21 -f 13/36/22 23/27/22 28/32/22 -f 21/28/23 27/37/23 22/31/23 -f 19/25/24 25/38/24 20/26/24 -f 28/32/25 32/39/25 33/40/25 -f 25/38/26 31/41/26 26/33/26 -f 24/35/27 9/42/27 29/43/27 -f 13/44/28 28/32/28 33/40/28 -f 27/37/29 31/41/29 32/39/29 -f 24/35/30 30/45/30 25/38/30 -f 33/40/31 37/46/31 38/47/31 -f 30/45/32 36/48/32 31/41/32 -f 29/43/33 9/49/33 34/50/33 -f 13/51/34 33/40/34 38/47/34 -f 32/39/35 36/48/35 37/46/35 -f 29/43/36 35/52/36 30/45/36 -f 37/46/37 43/53/37 38/47/37 -f 36/48/38 40/54/38 41/55/38 -f 34/50/39 9/56/39 39/57/39 -f 13/58/40 38/47/40 43/53/40 -f 36/48/41 42/59/41 37/46/41 -f 35/52/42 39/57/42 40/54/42 -f 41/55/43 45/60/43 46/61/43 -f 39/57/44 9/62/44 44/63/44 -f 13/64/45 43/53/45 48/65/45 -f 41/55/46 47/66/46 42/59/46 -f 40/54/47 44/63/47 45/60/47 -f 42/59/48 48/65/48 43/53/48 -f 44/67/49 9/68/49 49/69/49 -f 13/70/50 48/71/50 53/72/50 -f 46/73/51 52/74/51 47/75/51 -f 44/67/52 50/76/52 45/77/52 -f 48/71/53 52/74/53 53/72/53 -f 45/77/54 51/78/54 46/73/54 -f 13/79/55 53/72/55 58/80/55 -f 52/74/56 56/81/56 57/82/56 -f 49/69/57 55/83/57 50/76/57 -f 53/72/58 57/82/58 58/80/58 -f 50/76/59 56/81/59 51/78/59 -f 49/69/60 9/84/60 54/85/60 -f 13/86/61 58/80/61 12/14/61 -f 57/82/62 11/16/62 60/18/62 -f 54/85/63 59/19/63 55/83/63 -f 58/80/64 60/18/64 12/14/64 -f 55/83/65 11/16/65 56/81/65 -f 54/85/66 9/87/66 10/23/66 -f 11/16/8 16/22/8 17/17/8 -f 59/19/9 10/23/9 14/20/9 -f 60/18/10 17/17/10 18/15/10 -f 11/16/11 59/19/11 15/21/11 -f 15/21/13 14/20/13 19/25/13 -f 17/17/14 22/31/14 23/27/14 -f 16/22/15 15/21/15 20/26/15 -f 16/22/18 21/28/18 22/31/18 -f 22/31/19 27/37/19 28/32/19 -f 20/26/20 25/38/20 26/33/20 -f 21/28/23 26/33/23 27/37/23 -f 19/25/24 24/35/24 25/38/24 -f 28/32/25 27/37/25 32/39/25 -f 25/38/26 30/45/26 31/41/26 -f 27/37/29 26/33/29 31/41/29 -f 24/35/30 29/43/30 30/45/30 -f 33/40/31 32/39/31 37/46/31 -f 30/45/32 35/52/32 36/48/32 -f 32/39/35 31/41/35 36/48/35 -f 29/43/36 34/50/36 35/52/36 -f 37/46/37 42/59/37 43/53/37 -f 36/48/38 35/52/38 40/54/38 -f 36/48/41 41/55/41 42/59/41 -f 35/52/42 34/50/42 39/57/42 -f 41/55/43 40/54/43 45/60/43 -f 41/55/46 46/61/46 47/66/46 -f 40/54/47 39/57/47 44/63/47 -f 42/59/48 47/66/48 48/65/48 -f 46/73/51 51/78/51 52/74/51 -f 44/67/52 49/69/52 50/76/52 -f 48/71/53 47/75/53 52/74/53 -f 45/77/54 50/76/54 51/78/54 -f 52/74/56 51/78/56 56/81/56 -f 49/69/57 54/85/57 55/83/57 -f 53/72/58 52/74/58 57/82/58 -f 50/76/59 55/83/59 56/81/59 -f 57/82/62 56/81/62 11/16/62 -f 54/85/63 10/23/63 59/19/63 -f 58/80/64 57/82/64 60/18/64 -f 55/83/65 59/19/65 11/16/65 -f 5/1/1 7/88/1 3/2/1 -f 3/2/2 7/89/2 8/4/2 -f 7/6/3 5/12/3 6/7/3 -f 2/9/4 4/5/4 8/10/4 -f 1/3/5 3/2/5 4/5/5 -f 5/12/6 1/3/6 2/9/6 diff --git a/simul/assets/inputs_moving.csv b/simul/assets/inputs_moving.csv deleted file mode 100644 index f02d05c..0000000 --- a/simul/assets/inputs_moving.csv +++ /dev/null @@ -1,202 +0,0 @@ -time_delta_us,accel_x,accel_y,accel_z,rotation_x,rotation_y,rotation_z -40027,0.0013,0.0035,-1.0068,0.0266,-0.0666,0.1786 -39993,0.0021,0.0016,-1.0038,-0.0803,-0.1582,-0.1191 -40002,0.0006,0.0021,-0.9960,0.0953,0.1395,-0.0504 -39998,-0.0021,-0.0006,-1.0058,-0.1032,0.0250,0.1710 -40000,-0.0028,0.0038,-0.9975,0.0342,-0.0208,0.0565 -40000,-0.0036,0.0016,-1.0021,-0.0192,-0.0971,-0.0962 -40000,0.0006,0.0018,-1.0038,-0.0040,0.1624,0.1328 -40000,-0.0026,-0.0001,-0.9987,-0.0956,0.0250,-0.0656 -40000,-0.0060,-0.0006,-1.0048,-0.0803,0.1166,-0.1420 -40000,-0.0014,-0.0001,-0.9967,0.0647,0.0632,-0.2260 -40000,-0.0014,0.0023,-1.0002,-0.0574,-0.0208,-0.0962 -40000,-0.0072,-0.0004,-1.0053,0.0800,0.2082,0.0183 -40000,-0.0026,-0.0014,-0.9953,-0.1490,0.0632,0.0260 -40000,0.0018,0.0064,-1.0019,-0.0040,0.0021,0.0947 -40000,-0.0036,0.0038,-1.0068,-0.0421,0.1090,0.0183 -40000,0.0025,0.0016,-1.0021,0.1334,0.0250,-0.1573 -40000,0.0052,0.0008,-1.0075,-0.0574,-0.0437,0.2626 -40000,0.0030,0.0064,-0.9936,-0.0345,0.0632,0.0183 -40000,0.0023,-0.0033,-0.9992,-0.0498,0.0403,0.1252 -40000,0.0025,-0.0043,-0.9914,0.0647,-0.0284,0.1634 -40000,-0.0014,-0.0021,-0.9970,0.0724,-0.0513,0.2321 -40000,0.0016,0.0008,-1.0007,-0.1414,0.0174,0.0107 -40000,0.0003,-0.0021,-0.9975,-0.0421,0.2006,0.0870 -40000,0.0008,-0.0019,-0.9992,-0.0803,0.0556,0.1176 -40000,-0.0045,0.0035,-1.0019,0.1105,0.1395,-0.0351 -40000,0.0003,-0.0023,-0.9989,0.1411,0.0174,0.0565 -40000,0.0001,0.0028,-0.9987,0.0724,-0.1505,-0.1802 -40000,0.0033,-0.0021,-1.0036,0.0266,0.1930,0.1023 -40000,0.0038,0.0008,-0.9997,0.2632,-0.4330,0.0641 -40000,0.0506,0.0018,-0.9723,1.6449,-50.5093,-13.0351 -40000,-0.0165,0.0047,-1.0971,-1.6757,-22.4635,-6.9511 -40000,-0.0099,-0.0607,-1.1467,-1.9505,-87.3337,-25.0046 -40000,-0.1339,-0.0102,-1.3625,-15.0727,7.4220,-5.1344 -40000,-0.1015,0.0746,-1.0260,8.1716,42.2082,-14.8595 -40000,-0.0197,0.0548,-1.1093,-1.8131,23.3762,2.8427 -40000,-0.0207,0.0292,-1.0282,-11.0879,49.5976,5.4763 -40000,-0.0124,0.0729,-0.9242,-1.3627,28.2388,-0.5008 -40000,0.0538,0.0453,-1.0246,-8.7292,14.4678,6.3542 -40000,0.0260,0.0030,-1.0094,-13.2940,31.6205,7.6748 -40000,0.0511,0.0279,-0.9621,-14.0879,14.4296,8.6595 -40000,0.0533,0.0069,-0.9987,7.7823,6.0785,9.6290 -40000,0.0399,0.0296,-0.8827,0.0876,8.6663,7.2779 -40000,0.0335,-0.0019,-0.8967,6.1182,-4.0818,4.8046 -40000,0.0169,0.0062,-0.8508,4.5304,-10.9902,0.3160 -40000,-0.0026,-0.0194,-0.8945,16.9044,-20.2421,0.9420 -40000,-0.0294,0.0487,-1.0195,-4.1872,-16.0208,-2.4092 -40000,-0.0807,0.0868,-1.0053,38.2861,-3.3337,-2.4092 -40000,-0.0358,-0.0204,-0.9194,4.2632,-19.5322,4.0260 -40000,0.0016,0.0284,-0.8576,-26.2024,0.3151,-13.6382 -40000,0.0228,0.0125,-1.0732,12.5380,12.4983,-5.4244 -40000,0.0558,-0.0111,-0.9826,34.8892,108.4831,38.9649 -40000,0.1119,0.0770,-1.1088,5.8510,124.6510,23.8656 -40000,0.3009,-0.0807,-0.9504,-14.6605,88.9869,24.7740 -40000,0.3265,-0.0128,-0.9577,8.7823,185.8571,73.5450 -40000,0.2774,-0.0180,-0.8342,-5.4467,168.5441,32.6672 -40000,0.4522,-0.0368,-0.8549,3.3014,215.2998,34.0794 -40000,0.6808,-0.0636,-0.7858,2.6907,124.4144,28.3618 -40000,0.6158,-0.0946,-0.7475,-12.0650,-55.9597,-23.1649 -40000,0.5628,-0.0148,-0.8654,-36.6528,-128.6086,-60.9206 -40000,0.5758,0.0035,-0.8957,2.6907,-141.8528,-42.7145 -40000,0.4034,0.0150,-0.9931,26.1869,-170.8681,-68.4626 -40000,0.4059,-0.0148,-0.8495,-9.6070,-160.1887,-47.1420 -40000,0.2604,0.0262,-1.0668,-4.7368,-139.3261,-32.8748 -40000,0.0936,0.0472,-1.0195,10.9197,-134.0895,-37.0046 -40000,0.0736,0.0033,-0.9955,11.4617,-137.9444,-34.0428 -40000,-0.0587,0.0074,-0.9960,13.9350,-130.5780,-28.4244 -40000,-0.1320,-0.0104,-1.0160,17.0113,-132.9979,-21.0809 -40000,-0.1264,-0.0229,-1.0241,20.2403,-140.0284,-11.3710 -40000,-0.3998,-0.0189,-0.9291,28.3548,-143.2803,-5.2412 -40000,-0.4491,-0.0834,-0.8935,28.5304,-75.5017,-19.8137 -40000,-0.4696,-0.1056,-0.8300,24.8892,-26.7612,-4.5771 -40000,-0.3866,-0.1662,-0.7995,16.0647,62.8800,28.3924 -40000,-0.2577,-0.1278,-0.8696,3.5915,185.0479,71.0412 -40000,-0.2492,-0.0719,-0.9184,31.5304,184.3533,75.5985 -40000,-0.2084,-0.1276,-0.7682,-10.5765,194.5060,50.3847 -40000,0.3248,-0.0622,-1.2599,17.6220,249.0021,69.4840 -40000,0.0782,-0.1164,-0.9130,18.7212,170.7426,37.2473 -40000,0.2545,-0.1032,-0.8903,-10.7673,243.8037,39.4534 -40000,0.5404,-0.0822,-0.9626,13.5380,219.1930,23.3084 -40000,0.6239,-0.0814,-0.8417,-28.2711,121.3762,19.2092 -40000,0.7325,-0.1137,-0.8869,6.0342,100.1166,21.4458 -40000,0.5870,-0.0917,-0.8246,18.7899,-14.4788,-8.5771 -40000,0.6219,-0.0827,-0.7807,0.5533,-116.4406,-44.3863 -40000,0.4671,-0.0692,-0.9194,15.1029,-203.8757,-72.9130 -40000,0.4164,-0.0941,-0.8449,27.5914,-209.9139,-91.2260 -40000,0.3453,-0.1056,-0.8674,-1.9811,-191.9597,-72.4779 -40000,0.1217,-0.0512,-0.9880,-11.5002,-168.3337,-45.4779 -40000,-0.0006,-0.0087,-1.0900,15.4464,-160.4025,-59.6992 -40000,0.0057,-0.0453,-1.0212,7.0800,-187.5017,-64.1115 -40000,-0.2084,-0.0563,-1.0414,15.9808,-130.6162,-44.8824 -40000,-0.2899,-0.0954,-0.9833,24.2937,-111.1734,-38.0122 -40000,-0.3231,-0.1710,-0.8544,13.7289,-33.3872,-17.9130 -40003,-0.1605,-0.2396,-0.8207,11.9044,74.3609,35.5679 -39997,-0.1205,-0.2047,-0.7714,-6.1108,202.8189,105.3542 -40000,-0.0517,-0.0783,-0.9357,-6.0727,249.0021,94.6672 -40000,0.1671,-0.0814,-0.9797,-28.2788,203.4220,75.2397 -40000,0.2320,-0.0453,-0.9850,-23.9963,210.0937,66.2626 -40000,0.4010,-0.0414,-1.0802,12.3777,180.9945,71.0565 -40000,0.3792,-0.1222,-0.8449,23.1411,166.5212,46.9878 -40000,0.5477,-0.1261,-0.8427,-0.3627,161.3304,40.6290 -40000,0.7640,-0.1950,-0.7968,0.5838,82.1777,33.9267 -40000,0.5892,-0.1308,-0.8822,11.0342,-34.5475,-2.6458 -40000,0.6087,-0.1413,-0.8302,26.5838,-127.0895,-33.0198 -40000,0.5277,-0.1483,-0.8288,6.6602,-218.2421,-69.3328 -40000,0.3971,-0.1608,-0.8107,-15.9124,-167.7002,-50.7756 -40000,0.2660,-0.1039,-0.9906,-17.5154,-146.7841,-48.8748 -40000,0.1747,-0.0990,-0.9745,-7.3017,-155.6849,-50.0046 -40000,0.0389,-0.1007,-1.0478,-6.7063,-146.5093,-55.4397 -40000,0.0089,-0.0980,-0.9967,-16.9124,-171.3490,-53.7985 -40000,-0.1901,-0.0480,-1.0519,-4.9276,-173.4635,-62.5695 -40000,-0.2458,-0.0709,-1.0260,14.1258,-138.9139,-49.8595 -40000,-0.3146,-0.1337,-0.8893,18.1563,-86.2879,-34.8977 -40000,-0.3827,-0.1339,-0.9042,13.6602,-43.9673,-22.9969 -40000,-0.3686,-0.1630,-0.8632,16.4235,-17.0666,-19.2412 -40000,-0.1935,-0.2294,-0.7309,-1.7597,96.9563,42.1863 -40000,-0.2169,-0.1117,-0.9701,-5.4544,208.5746,103.0565 -40000,-0.1786,-0.1605,-0.7995,-19.7979,183.2846,83.6290 -40000,0.0650,-0.0465,-0.9518,-39.5002,242.3609,95.5374 -40000,0.2164,-0.0199,-1.1952,-27.1185,169.1777,74.5221 -40000,0.2459,-0.0514,-0.9538,-14.7902,147.8189,63.6061 -40000,0.4134,-0.0756,-1.0270,4.4311,164.0174,56.1405 -40000,0.3802,-0.1012,-0.8586,-5.7215,73.3304,36.1176 -40000,0.5226,-0.1078,-0.8429,-9.8895,99.0556,41.5908 -40000,0.4972,-0.0888,-0.9225,7.2327,52.0632,28.6443 -40000,0.4291,-0.0963,-0.9196,-10.1185,-78.4864,-23.2870 -40000,0.4977,-0.0941,-0.7626,-32.3169,-93.1505,-18.4550 -40000,0.3338,-0.0399,-0.9530,-27.9124,-114.2727,-17.1649 -40000,0.1883,0.0165,-0.9753,-26.4391,-218.1353,-75.6611 -40000,0.3189,-0.0263,-0.9499,-14.6070,-132.8681,-43.4473 -40000,0.0511,0.0106,-1.0146,-16.8131,-120.5322,-41.8290 -40000,0.0208,-0.0119,-1.0397,-9.2101,-157.6925,-75.5313 -40000,-0.1046,0.0072,-0.9887,-2.7292,-116.3643,-55.9282 -40000,-0.1796,0.0133,-1.0343,-4.5231,-95.3872,-36.3099 -40000,-0.2731,0.0123,-0.9828,14.3701,-111.2879,-63.3099 -40000,-0.2909,-0.0297,-0.8554,16.3243,-59.3566,-28.4092 -40000,-0.3219,-0.0604,-0.8837,12.7899,27.0861,6.1634 -40000,-0.2770,-0.0724,-0.8742,6.2861,89.0327,39.2855 -40000,-0.1437,-0.0275,-1.0827,28.0266,215.3762,72.7893 -40000,-0.0692,-0.0561,-0.9093,48.5609,201.1624,56.8809 -40000,0.0963,-0.0519,-1.0107,8.4388,189.9640,34.7282 -40000,0.1566,-0.0998,-0.9284,16.7976,184.5594,29.8427 -40000,0.3392,-0.0741,-0.9474,-10.5002,139.5975,11.3237 -40000,0.3626,-0.0956,-0.8893,15.6907,139.8571,29.2931 -40000,0.5099,-0.0854,-0.8449,20.7289,88.0479,12.7206 -40000,0.4332,-0.0695,-0.9696,32.3014,-90.7307,-7.2718 -40000,0.3797,-0.1220,-0.8822,13.8968,-139.7612,-27.8519 -40000,0.3651,-0.1691,-0.8547,11.7518,-62.4024,-14.7603 -40000,0.3214,-0.1525,-0.9499,-14.7292,-109.9063,-3.3786 -40000,0.1546,-0.1020,-1.0485,20.5762,-150.8299,-45.9664 -40000,0.2191,-0.1435,-0.8693,-0.8284,-126.8605,-41.9664 -40000,0.0248,-0.1439,-1.0016,-3.7063,-140.8452,-38.0886 -40000,-0.0529,-0.1369,-1.0180,-18.7215,-132.1505,-51.8748 -40000,-0.0800,-0.1681,-1.0041,-11.6834,-104.6391,-47.9817 -40000,-0.1562,-0.1471,-0.9848,-31.4620,-115.2116,-36.4168 -40000,-0.2641,-0.1129,-1.0697,-20.0956,-98.9673,-28.0580 -40000,-0.3078,-0.1049,-0.9443,-7.5078,-49.8376,-26.6229 -40000,-0.3478,-0.0910,-0.9584,-7.0269,-15.8986,-0.1802 -40000,-0.2860,-0.1330,-0.9357,10.7060,61.8953,22.3466 -40000,-0.2128,-0.1061,-1.0053,42.8510,186.2311,77.7359 -40000,-0.2211,-0.0878,-0.9601,-3.9353,124.0098,60.1328 -40000,-0.0492,-0.1361,-1.0278,26.8968,201.2159,55.1557 -40000,0.0677,-0.1098,-0.9975,39.7976,247.2464,56.8046 -40000,0.2589,-0.1466,-0.9784,-0.6528,137.8189,14.6519 -40000,0.3414,-0.1686,-0.8063,-12.8895,203.4678,9.2473 -40000,0.4793,-0.1300,-1.0607,70.5762,249.0021,33.4992 -40000,0.6000,-0.1957,-0.7602,76.6449,173.8113,10.5145 -40000,0.7042,-0.2672,-0.4201,-28.4009,14.7502,-16.2641 -40000,0.6393,-0.1898,-0.8586,-41.9047,-36.0971,-13.9740 -40000,0.6451,-0.1962,-0.7150,-27.7521,-83.2727,-10.1038 -40000,0.5301,-0.1593,-0.7724,-31.6070,-112.5856,-8.4855 -40000,0.5526,-0.1469,-0.9384,-17.6834,-115.0818,-6.7221 -40000,0.2538,-0.0072,-1.0468,-56.4696,-251.2650,-84.4702 -40000,0.2984,-0.1574,-0.8437,-25.8818,-195.5399,-80.7756 -40000,0.1251,-0.0966,-1.1110,-3.4162,-111.7078,-23.8519 -40000,0.0177,-0.0290,-1.0024,16.9426,-138.2269,-25.9817 -40000,-0.0043,-0.0773,-1.0768,10.2708,-163.9979,-24.9435 -40000,-0.1728,-0.1093,-0.8061,25.2937,-59.6849,-5.6992 -40000,-0.1889,-0.1410,-0.9391,7.5227,-74.8147,-4.1878 -40000,-0.1657,-0.1127,-0.8664,5.6525,-12.8910,30.9573 -40000,-0.3175,-0.0709,-1.2196,43.1945,64.5289,54.6901 -40000,-0.2438,-0.1466,-1.1637,181.5227,57.4144,20.7282 -40000,-0.0890,-0.2565,-0.9384,160.8128,57.9182,-1.8290 -40000,-0.1803,-0.3703,-0.9142,130.2937,24.4373,-5.6305 -40000,-0.0670,-0.4188,-0.7580,96.8281,13.8876,-36.0351 -40000,-0.0214,-0.4904,-0.7804,71.0724,20.6892,-13.2031 -40000,-0.0343,-0.5338,-0.7399,11.1258,14.8495,-3.5313 -40000,-0.0985,-0.5421,-0.7265,-43.2177,11.6205,3.3008 -40000,-0.0873,-0.3944,-0.6347,-148.5231,14.7579,19.9573 -40000,-0.1256,-0.2963,-0.9223,-198.7979,20.3609,7.9420 -40000,0.0514,-0.1913,-1.1122,-141.9124,11.9640,11.6748 -40000,-0.1347,-0.1269,-0.9872,-103.5536,-9.0208,-5.8901 -40000,0.0594,-0.1217,-0.8813,-92.2788,37.0861,-0.8443 -40003,-0.0214,0.0216,-1.1484,-81.5154,21.4754,5.0718 -39997,0.0545,0.0365,-1.0751,-59.0421,21.3533,11.8656 -40000,0.0040,0.0721,-1.1127,0.9808,21.5441,6.9496 -40000,0.0406,0.0577,-1.1217,36.9960,22.4449,-2.2412 -40000,0.0694,-0.0387,-1.1364,137.9044,32.2159,-2.3634 -40000,0.1168,-0.1154,-1.0627,194.2098,43.4678,-13.0885 -40000,0.1161,-0.2560,-0.8837,166.0571,42.2006,-3.3863 -40000,0.2018,-0.3476,-0.9196,88.5151,19.3227,2.0870 - diff --git a/simul/assets/inputs_still.csv b/simul/assets/inputs_still.csv deleted file mode 100644 index 3df6c09..0000000 --- a/simul/assets/inputs_still.csv +++ /dev/null @@ -1,202 +0,0 @@ -time_delta_us,accel_x,accel_y,accel_z,rotation_x,rotation_y,rotation_z -40024,-0.0034,-0.0021,-0.9975,0.0803,-0.1545,-0.3072 -39995,0.0030,0.0010,-1.0006,-0.2174,-0.0324,-0.1392 -40002,0.0005,-0.0073,-1.0006,-0.0418,0.1585,0.1508 -39998,-0.0007,-0.0033,-0.9940,0.0269,0.0058,0.0898 -40000,0.0025,0.0008,-0.9960,-0.1411,0.0516,0.1356 -40000,-0.0014,0.0020,-1.0070,0.0116,0.0287,0.1356 -40000,0.0008,-0.0024,-0.9879,0.0650,0.1661,0.0134 -40000,-0.0004,-0.0002,-0.9970,-0.0953,-0.0095,0.0134 -40000,-0.0051,-0.0055,-1.0036,0.0498,-0.0324,-0.0018 -40000,0.0052,0.0030,-1.0050,0.0879,-0.1545,-0.2232 -40000,0.0032,-0.0033,-0.9967,0.0116,0.0440,0.0592 -40000,-0.0012,0.0052,-1.0060,0.0879,-0.0247,-0.0629 -40000,-0.0009,-0.0046,-0.9923,-0.1258,0.0211,-0.2461 -40000,-0.0002,-0.0031,-0.9994,-0.0724,-0.0095,0.0592 -40000,0.0045,-0.0092,-0.9965,0.1108,-0.1850,0.0058 -40000,0.0025,0.0001,-1.0019,-0.1487,0.0974,0.0592 -40000,-0.0026,-0.0075,-0.9965,0.0727,-0.0324,0.1127 -40000,0.0001,0.0001,-0.9975,-0.0418,0.1203,-0.1698 -40000,0.0042,-0.0051,-1.0033,0.0345,-0.0095,0.0821 -40000,-0.0007,-0.0026,-0.9999,0.0574,0.0134,-0.0782 -40000,0.0088,-0.0002,-0.9992,-0.0113,0.0287,-0.0095 -40000,0.0005,-0.0038,-1.0038,-0.1258,-0.0782,-0.0553 -40000,0.0005,-0.0063,-0.9984,0.2253,-0.0553,-0.3072 -40000,0.0071,-0.0036,-0.9938,0.0345,0.0211,-0.0171 -40000,0.0020,-0.0014,-0.9870,-0.1182,0.1585,-0.0324 -40000,0.0020,-0.0041,-0.9994,-0.0113,-0.2079,-0.1240 -40000,-0.0063,-0.0046,-1.0019,-0.0113,0.1585,0.0821 -40000,-0.0019,-0.0014,-0.9921,-0.0953,-0.2003,0.0745 -40000,0.0081,0.0045,-1.0043,-0.0418,0.1508,-0.2003 -40000,-0.0017,0.0013,-0.9992,-0.1563,-0.0705,-0.1469 -40000,0.0020,-0.0026,-0.9972,-0.1869,0.0745,0.0058 -40000,-0.0026,-0.0024,-0.9982,-0.0495,-0.0095,-0.1545 -40000,0.0042,0.0008,-0.9979,-0.0495,-0.0934,0.0592 -40000,0.0086,0.0010,-0.9977,0.1948,-0.0324,-0.1163 -40000,0.0064,-0.0021,-1.0014,-0.0418,-0.0171,-0.1240 -40000,0.0030,0.0040,-0.9950,-0.0266,-0.0095,0.1279 -40000,-0.0017,-0.0060,-0.9943,0.0040,0.1661,-0.1011 -40000,0.0003,-0.0055,-0.9999,-0.1258,-0.0018,-0.0705 -40000,-0.0002,-0.0046,-0.9982,-0.0037,-0.0247,0.0516 -40000,0.0001,-0.0021,-1.0065,0.1185,-0.1011,0.0440 -40000,-0.0002,0.0030,-1.0023,-0.1182,0.0211,0.0974 -40000,0.0005,-0.0060,-1.0001,-0.0647,0.2272,0.1432 -40000,-0.0007,-0.0041,-1.0004,-0.0113,0.0134,-0.0400 -40000,0.0010,-0.0014,-0.9926,-0.0647,-0.1011,-0.1469 -40000,-0.0017,-0.0009,-0.9933,0.0650,0.1432,-0.0324 -40000,-0.0038,-0.0077,-0.9958,0.1566,-0.0705,-0.0934 -40000,-0.0004,-0.0090,-0.9955,0.1032,-0.0018,-0.1774 -40000,-0.0004,-0.0033,-1.0023,-0.0647,0.0592,-0.0247 -40000,0.0035,-0.0021,-0.9940,0.1566,-0.0934,0.2043 -40000,-0.0007,-0.0060,-0.9887,0.1337,0.0745,-0.0553 -40000,0.0013,0.0010,-0.9926,0.1108,-0.1927,0.0287 -40000,0.0030,-0.0004,-0.9962,0.0269,0.0287,-0.1927 -40000,0.0040,0.0010,-0.9987,-0.0418,0.0745,-0.0705 -40000,0.0018,0.0003,-0.9984,0.0269,0.1203,-0.0934 -40000,-0.0026,-0.0033,-0.9979,0.1261,-0.0171,0.0592 -40000,0.0030,-0.0068,-1.0001,-0.1411,0.0516,0.1356 -40000,0.0071,0.0018,-0.9955,-0.0113,0.0134,-0.1545 -40000,0.0001,-0.0016,-0.9958,0.0116,-0.1011,0.0821 -40000,0.0042,0.0015,-1.0004,0.0498,-0.0171,-0.1469 -40000,0.0032,-0.0063,-1.0094,-0.0953,0.0745,0.1585 -40000,-0.0031,-0.0070,-0.9933,-0.1334,0.0363,0.0898 -40000,0.0010,0.0003,-0.9892,0.0116,0.0058,-0.0553 -40000,0.0015,-0.0026,-0.9965,0.0956,0.0134,-0.1240 -40000,0.0010,-0.0009,-1.0009,0.2406,0.0287,-0.1392 -40000,0.0020,-0.0053,-0.9984,-0.1411,0.0363,-0.2003 -40000,0.0084,-0.0019,-0.9982,-0.0571,-0.1392,-0.2614 -40000,0.0074,-0.0038,-1.0077,-0.0342,0.0669,-0.2079 -40000,-0.0004,-0.0009,-1.0082,-0.1716,0.0058,0.3188 -40000,-0.0036,-0.0033,-0.9965,0.0956,-0.0018,0.0745 -40000,0.0018,-0.0087,-0.9992,-0.0647,-0.2079,-0.3606 -40000,0.0020,0.0047,-0.9997,0.0650,-0.1392,-0.0476 -40000,0.0013,-0.0002,-0.9999,-0.0495,0.1966,0.1661 -40000,-0.0034,-0.0024,-0.9999,0.0345,0.0898,-0.0247 -40000,0.0025,-0.0012,-0.9955,0.0269,-0.1469,-0.1087 -40000,0.0047,-0.0014,-0.9992,-0.0266,0.0287,-0.1163 -40000,-0.0017,-0.0021,-0.9999,0.1414,0.0821,-0.0782 -40000,0.0015,-0.0016,-0.9926,-0.0037,0.0134,0.1279 -40000,0.0027,-0.0051,-1.0019,-0.1792,-0.0324,-0.0934 -40000,-0.0009,-0.0051,-1.0006,-0.1792,-0.0476,0.1050 -40000,0.0010,-0.0038,-1.0014,-0.1258,0.2043,-0.0018 -40000,-0.0021,-0.0004,-0.9999,0.0116,0.0440,-0.0400 -40000,0.0023,-0.0016,-0.9945,-0.1182,-0.0476,0.0898 -40000,0.0001,0.0008,-0.9977,0.0727,0.0440,0.1508 -40000,-0.0024,-0.0024,-1.0006,-0.0953,0.0363,-0.2766 -40000,-0.0017,-0.0016,-1.0041,0.0116,0.0516,-0.1621 -40000,0.0074,0.0018,-0.9933,-0.0800,-0.0247,-0.0476 -40000,0.0052,-0.0048,-0.9928,0.0650,-0.1240,-0.0934 -40000,-0.0043,-0.0033,-0.9958,0.0269,0.0745,0.1585 -40000,0.0042,-0.0060,-0.9992,0.0727,-0.1011,0.0516 -40000,-0.0029,0.0015,-0.9967,-0.0876,-0.0476,0.1203 -40000,0.0023,-0.0031,-1.0067,-0.0495,0.0211,-0.0095 -40000,-0.0002,0.0003,-0.9997,-0.1411,0.2653,0.2119 -40006,0.0037,0.0023,-0.9940,-0.0724,0.2272,0.0363 -39994,0.0008,0.0018,-1.0004,0.1185,0.1127,0.0669 -40000,0.0005,-0.0033,-1.0016,0.0727,0.1890,-0.0171 -40000,-0.0004,0.0010,-1.0009,-0.0647,0.1127,0.0745 -40000,0.0027,-0.0107,-0.9982,0.2101,-0.0324,-0.1469 -40000,0.0015,0.0023,-0.9970,0.0803,0.0058,-0.2079 -40000,0.0040,0.0001,-0.9987,-0.0495,-0.0858,0.0669 -40000,0.0040,0.0025,-0.9970,0.1337,0.0134,-0.0553 -40000,0.0027,-0.0021,-0.9950,0.0345,0.0745,0.2653 -40000,0.0054,-0.0012,-0.9938,0.0421,-0.0247,0.0440 -40000,0.0023,0.0001,-1.0014,-0.0418,-0.0782,-0.0553 -40000,-0.0002,-0.0073,-1.0016,0.0421,0.1432,0.0440 -40000,-0.0024,-0.0021,-0.9938,-0.0189,0.1050,-0.0476 -40000,-0.0007,-0.0009,-0.9928,-0.0571,0.0134,0.2119 -40000,0.0027,0.0003,-1.0023,-0.0953,-0.2843,0.2043 -40000,0.0005,0.0008,-1.0023,-0.0189,-0.0018,-0.1774 -40000,0.0037,0.0001,-1.0031,-0.0342,0.0440,-0.0095 -40000,-0.0024,0.0028,-1.0006,-0.0953,0.0058,0.1203 -40000,0.0015,-0.0004,-0.9936,0.0421,0.0516,-0.0171 -40000,0.0042,-0.0053,-0.9979,0.0040,-0.0629,0.0516 -40000,0.0027,0.0025,-0.9926,0.0116,0.0745,-0.3072 -40000,-0.0021,-0.0065,-0.9960,-0.0418,0.0058,0.1356 -40000,-0.0009,-0.0060,-0.9972,-0.0800,0.1127,-0.0400 -40000,0.0005,-0.0065,-0.9950,0.0116,-0.0858,-0.1163 -40000,-0.0012,0.0020,-0.9958,0.0269,0.1356,0.1356 -40000,0.0013,-0.0016,-0.9943,0.0421,-0.1240,-0.0247 -40000,0.0062,-0.0085,-1.0016,-0.1411,0.2501,-0.0476 -40000,0.0005,-0.0004,-0.9933,0.0116,0.0898,0.0516 -40000,0.0018,-0.0009,-0.9977,0.0574,-0.2461,-0.1163 -40000,0.0040,0.0025,-0.9977,0.1643,0.0516,0.0974 -40000,-0.0014,-0.0024,-1.0023,0.1108,0.1585,-0.0171 -40000,-0.0021,-0.0007,-1.0014,-0.1029,-0.0476,-0.1698 -40000,0.0018,-0.0007,-0.9933,-0.2708,0.0440,-0.0705 -40000,0.0032,0.0015,-0.9945,-0.0495,0.0898,-0.0782 -40000,-0.0017,-0.0016,-0.9972,-0.0266,-0.0171,0.0974 -40000,0.0023,-0.0019,-0.9955,0.0574,0.1050,0.0745 -40000,-0.0046,0.0025,-0.9962,0.2024,-0.1545,0.1661 -40000,-0.0026,-0.0007,-0.9994,0.0574,0.0592,0.0669 -40000,0.0037,-0.0070,-0.9953,0.0574,-0.1392,-0.0934 -40000,0.0032,-0.0048,-1.0006,-0.0876,0.0211,-0.0476 -40000,0.0027,-0.0077,-0.9931,-0.1792,0.0516,-0.1927 -40000,0.0025,0.0010,-0.9906,-0.1182,0.0669,0.0287 -40000,0.0010,-0.0046,-0.9938,0.0421,0.1127,0.0287 -40000,0.0032,-0.0004,-0.9999,0.0192,-0.0705,-0.2537 -40000,-0.0009,0.0047,-0.9901,-0.1029,0.1966,0.0745 -40000,0.0064,-0.0033,-0.9911,-0.0953,0.1356,0.0134 -40000,0.0008,-0.0048,-0.9962,-0.0189,0.0745,0.0134 -40000,0.0010,-0.0090,-0.9982,0.0727,0.0669,-0.1698 -40000,0.0010,-0.0002,-1.0019,0.0727,-0.0782,0.0058 -40000,0.0059,-0.0048,-1.0011,-0.0647,-0.0247,0.1127 -40000,0.0032,-0.0073,-0.9975,0.0421,-0.0782,0.2195 -40000,0.0045,-0.0012,-0.9945,0.0727,0.1432,-0.1469 -40000,-0.0002,-0.0082,-0.9918,-0.0953,-0.0018,0.2577 -40000,0.0008,-0.0043,-0.9953,0.0192,-0.1316,0.0821 -40000,-0.0021,-0.0016,-0.9936,0.0345,0.1203,0.3340 -40000,0.0040,-0.0014,-0.9962,-0.0724,0.0516,-0.1087 -40000,0.0013,-0.0065,-0.9999,-0.0647,-0.2308,0.2043 -40000,-0.0034,-0.0041,-0.9992,0.0421,0.0516,0.2806 -40000,-0.0043,-0.0002,-0.9955,-0.1563,0.0287,-0.1545 -40000,0.0020,-0.0031,-0.9926,0.0727,-0.0247,-0.0553 -40000,0.0042,-0.0026,-0.9904,0.0192,0.0974,0.1356 -40000,-0.0002,0.0032,-0.9967,-0.1563,0.0592,0.1203 -40000,0.0005,-0.0055,-0.9997,-0.0037,0.0821,0.0287 -40000,0.0015,0.0015,-0.9955,0.0574,0.0592,0.0440 -40000,0.0040,-0.0031,-0.9982,-0.0418,-0.0171,0.0821 -40000,-0.0007,0.0037,-1.0031,-0.0266,0.1508,-0.0171 -40000,-0.0070,-0.0048,-1.0045,-0.0800,0.0287,0.0592 -40000,0.0030,-0.0014,-0.9943,-0.0495,-0.1316,-0.2919 -40000,0.0025,-0.0007,-1.0067,-0.0495,-0.0247,-0.1545 -40000,-0.0029,0.0064,-0.9923,0.0192,0.0592,0.2195 -40000,-0.0012,-0.0026,-1.0016,-0.2250,-0.0171,-0.1163 -40000,0.0001,-0.0024,-1.0065,0.1261,-0.0171,0.0211 -40000,-0.0034,0.0025,-1.0060,0.0956,-0.0171,0.0592 -40000,0.0032,-0.0043,-0.9979,-0.0037,0.0974,0.0440 -40000,0.0003,0.0018,-1.0023,-0.0418,-0.0247,-0.1240 -40000,0.0027,-0.0012,-1.0006,0.0269,-0.0095,-0.1087 -40000,0.0015,-0.0009,-0.9911,0.0269,-0.0247,0.0058 -40000,-0.0012,-0.0014,-0.9987,0.0269,0.0592,0.2730 -40000,-0.0056,-0.0004,-1.0026,0.0803,-0.0247,-0.0476 -40000,0.0032,0.0076,-0.9965,-0.1945,0.0287,-0.1087 -40000,0.0010,0.0025,-0.9889,-0.1334,0.0287,-0.2079 -40000,0.0008,-0.0014,-0.9933,-0.0953,0.1737,-0.1698 -40000,-0.0004,-0.0031,-0.9931,0.0803,0.0974,-0.0629 -40000,-0.0007,-0.0016,-0.9989,-0.0495,-0.0705,0.0211 -40000,0.0015,-0.0058,-0.9979,0.1261,0.0974,-0.0782 -40000,0.0081,-0.0085,-1.0067,0.1108,-0.0476,0.0592 -40000,-0.0031,0.0042,-0.9994,-0.0113,-0.0018,-0.0476 -40000,0.0008,-0.0048,-0.9970,-0.0266,0.0363,-0.0171 -40000,-0.0014,0.0013,-0.9972,0.0116,-0.0934,0.0440 -40000,0.0005,0.0023,-0.9960,0.0345,-0.0247,-0.1240 -40000,0.0049,0.0003,-0.9948,0.0803,-0.0018,-0.2003 -40000,0.0037,-0.0014,-0.9992,0.1872,-0.0858,-0.2385 -40000,-0.0009,-0.0014,-1.0045,0.1490,-0.0858,-0.1163 -40000,-0.0004,-0.0004,-1.0104,-0.0953,0.1127,-0.0400 -40000,-0.0009,0.0047,-1.0036,-0.0113,-0.0858,0.0058 -40000,-0.0017,-0.0009,-1.0004,-0.0037,0.0440,-0.1850 -40000,0.0047,0.0018,-0.9914,-0.0037,0.0592,-0.0782 -40000,0.0047,0.0047,-0.9936,-0.1563,0.0745,-0.2079 -40000,0.0054,0.0008,-0.9955,0.0574,0.0898,-0.0553 -40000,-0.0009,0.0010,-0.9933,-0.0189,0.1737,-0.1621 -40000,0.0042,-0.0055,-1.0004,0.0574,-0.0247,-0.1240 -40000,0.0008,-0.0016,-0.9943,-0.0647,0.0974,0.1356 -40000,-0.0012,-0.0058,-0.9931,0.0956,0.1050,-0.2079 -40000,0.0008,0.0032,-1.0036,0.0345,0.1356,-0.0018 -40000,0.0013,-0.0029,-0.9989,-0.0647,0.0821,0.0516 -40000,0.0013,-0.0031,-0.9921,-0.0189,0.0898,-0.0171 -40000,0.0013,-0.0021,-0.9938,0.0192,0.0363,-0.1698 -40000,-0.0007,0.0020,-1.0045,-0.0495,0.1127,-0.0934 - diff --git a/simul/assets/probe.mtl b/simul/assets/probe.mtl deleted file mode 100644 index 31c5ac7..0000000 --- a/simul/assets/probe.mtl +++ /dev/null @@ -1,12 +0,0 @@ -# Blender 5.1.0 MTL File: 'None' -# www.blender.org - -newmtl Material -Ns 250.000000 -Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 -Ks 0.500000 0.500000 0.500000 -Ke 0.000000 0.000000 0.000000 -Ni 1.500000 -d 1.000000 -illum 2 diff --git a/simul/assets/probe.obj b/simul/assets/probe.obj deleted file mode 100644 index 46a6202..0000000 --- a/simul/assets/probe.obj +++ /dev/null @@ -1,400 +0,0 @@ -# Blender 5.1.0 -# www.blender.org -mtllib probe.mtl -o Cube -v 1.000000 0.101130 -1.527883 -v 1.000000 -0.101130 -1.527883 -v 1.000000 0.101130 1.527883 -v 1.000000 -0.101130 1.527883 -v -1.000000 0.101130 -1.527883 -v -1.000000 -0.101130 -1.527883 -v -1.000000 0.101130 1.527883 -v -1.000000 -0.101130 1.527883 -v 0.008186 -0.628219 0.059172 -v 0.539580 -0.256799 0.412578 -v -0.194785 -0.256799 0.631000 -v -0.648653 -0.256796 0.059172 -v -0.194785 -0.256799 -0.512655 -v 0.539580 -0.256799 -0.294233 -v 0.211156 0.344187 0.631000 -v -0.523209 0.344187 0.412578 -v -0.523209 0.344187 -0.294233 -v 0.211156 0.344187 -0.512655 -v 0.665024 0.344184 0.059172 -v 0.008186 0.715607 0.059172 -v -0.111117 -0.527872 0.395282 -v 0.320529 -0.527872 0.266897 -v 0.201228 -0.309556 0.603010 -v 0.632875 -0.309555 0.059172 -v 0.320529 -0.527872 -0.148553 -v -0.377894 -0.527870 0.059172 -v -0.497199 -0.309555 0.395283 -v -0.111117 -0.527872 -0.276937 -v -0.497199 -0.309555 -0.276938 -v 0.201228 -0.309556 -0.484666 -v 0.706613 0.043694 0.266898 -v 0.706613 0.043694 -0.148554 -v 0.008186 0.043694 0.731397 -v 0.439837 0.043694 0.603014 -v -0.690242 0.043694 0.266898 -v -0.423466 0.043694 0.603014 -v -0.423466 0.043694 -0.484669 -v -0.690242 0.043694 -0.148554 -v 0.439837 0.043694 -0.484669 -v 0.008186 0.043694 -0.613053 -v 0.513570 0.396943 0.395283 -v -0.184857 0.396944 0.603010 -v -0.616504 0.396943 0.059172 -v -0.184857 0.396944 -0.484666 -v 0.513570 0.396943 -0.276938 -v 0.127488 0.615260 0.395282 -v 0.394265 0.615258 0.059172 -v -0.304158 0.615260 0.266897 -v -0.304158 0.615260 -0.148553 -v 0.127488 0.615260 -0.276937 -v -0.213092 0.101130 -0.296547 -v -0.174677 0.139545 -1.446611 -v 0.211278 0.101130 -0.296547 -v 0.172863 0.139545 -1.446611 -v 0.211278 0.397765 -0.296547 -v 0.121256 0.487787 -0.296547 -v 0.105344 0.449373 -1.446611 -v 0.172863 0.381853 -1.446611 -v -0.123065 0.487787 -0.296547 -v -0.213092 0.397760 -0.296547 -v -0.174677 0.381849 -1.446611 -v -0.107153 0.449373 -1.446611 -v 0.211278 0.101130 -1.446611 -v -0.213092 0.101130 -1.446611 -v 0.211278 0.397765 -1.446611 -v 0.121256 0.487787 -1.446611 -v -0.123065 0.487787 -1.446611 -v -0.213092 0.397760 -1.446611 -v -0.174677 0.139545 -0.777891 -v 0.172863 0.139545 -0.777891 -v 0.105344 0.449372 -0.777891 -v 0.172863 0.381853 -0.777891 -v -0.174677 0.381848 -0.777891 -v -0.107153 0.449372 -0.777891 -vn -0.0000 -0.0000 1.0000 -vn -1.0000 -0.0000 -0.0000 -vn -0.0000 -1.0000 -0.0000 -vn 1.0000 -0.0000 -0.0000 -vn -0.0000 -0.0000 -1.0000 -vn 0.0938 -0.9444 0.3152 -vn 0.6679 -0.6898 0.2793 -vn -0.2467 -0.9491 0.1958 -vn -0.2467 -0.9491 -0.1958 -vn 0.0938 -0.9444 -0.3152 -vn 0.8895 -0.3549 0.2878 -vn 0.0227 -0.3305 0.9435 -vn -0.8722 -0.3540 0.3375 -vn -0.5406 -0.3397 -0.7696 -vn 0.5011 -0.3385 -0.7965 -vn 0.7763 -0.1328 0.6162 -vn -0.2828 -0.1267 0.9508 -vn -0.9906 -0.1371 -0.0000 -vn -0.2828 -0.1267 -0.9508 -vn 0.7763 -0.1328 -0.6162 -vn 0.3794 0.6710 0.6370 -vn -0.4393 0.6741 0.5938 -vn -0.6679 0.6898 -0.2793 -vn 0.0353 0.6620 -0.7487 -vn 0.6927 0.6919 -0.2035 -vn 0.2467 0.9491 -0.1958 -vn 0.4585 0.8108 -0.3639 -vn 0.3794 0.6710 -0.6370 -vn -0.0938 0.9444 -0.3152 -vn -0.1722 0.7971 -0.5788 -vn -0.4393 0.6741 -0.5938 -vn -0.3059 0.9521 -0.0000 -vn -0.5729 0.8196 -0.0000 -vn -0.6679 0.6898 0.2793 -vn -0.0938 0.9444 0.3152 -vn -0.1722 0.7971 0.5788 -vn 0.0353 0.6620 0.7487 -vn 0.2467 0.9491 0.1958 -vn 0.4585 0.8108 0.3639 -vn 0.6927 0.6919 0.2035 -vn 0.8722 0.3540 -0.3375 -vn 0.7677 0.1981 -0.6094 -vn 0.5406 0.3397 -0.7696 -vn -0.0227 0.3305 -0.9435 -vn -0.2799 0.1891 -0.9412 -vn -0.5011 0.3385 -0.7965 -vn -0.8895 0.3549 -0.2878 -vn -0.9789 0.2043 -0.0000 -vn -0.8895 0.3549 0.2878 -vn -0.5011 0.3385 0.7965 -vn -0.2799 0.1891 0.9412 -vn -0.0227 0.3305 0.9435 -vn 0.5406 0.3397 0.7696 -vn 0.7677 0.1981 0.6094 -vn 0.8722 0.3540 0.3375 -vn 0.2828 0.1267 -0.9508 -vn 0.2799 -0.1891 -0.9412 -vn 0.0227 -0.3305 -0.9435 -vn -0.7763 0.1328 -0.6162 -vn -0.7677 -0.1981 -0.6094 -vn -0.8722 -0.3540 -0.3375 -vn -0.7763 0.1328 0.6162 -vn -0.7677 -0.1981 0.6094 -vn -0.5406 -0.3397 0.7696 -vn 0.2828 0.1267 0.9508 -vn 0.2799 -0.1891 0.9412 -vn 0.5011 -0.3385 0.7965 -vn 0.9906 0.1371 -0.0000 -vn 0.9789 -0.2043 -0.0000 -vn 0.8895 -0.3549 -0.2878 -vn 0.4393 -0.6741 -0.5938 -vn 0.1722 -0.7971 -0.5788 -vn -0.0353 -0.6620 -0.7487 -vn -0.3794 -0.6710 -0.6370 -vn -0.4585 -0.8108 -0.3639 -vn -0.6927 -0.6919 -0.2035 -vn -0.6927 -0.6919 0.2035 -vn -0.4585 -0.8108 0.3639 -vn -0.3794 -0.6710 0.6370 -vn 0.6679 -0.6898 -0.2793 -vn 0.5729 -0.8196 -0.0000 -vn 0.3059 -0.9521 -0.0000 -vn -0.0353 -0.6620 0.7487 -vn 0.1722 -0.7971 0.5788 -vn 0.4393 -0.6741 0.5938 -vn 0.7071 0.7071 -0.0000 -vn -0.7071 0.7071 -0.0000 -vn -0.0000 1.0000 -0.0000 -vn 0.7071 -0.7071 -0.0000 -vn -0.7071 -0.7071 -0.0000 -vt 0.625000 0.750000 -vt 0.375000 1.000000 -vt 0.375000 0.750000 -vt 0.625000 0.000000 -vt 0.375000 0.250000 -vt 0.375000 0.000000 -vt 0.375000 0.500000 -vt 0.125000 0.750000 -vt 0.125000 0.500000 -vt 0.625000 0.500000 -vt 0.625000 0.250000 -vt 0.181819 0.000000 -vt 0.227273 0.078731 -vt 0.136365 0.078731 -vt 0.272728 0.157461 -vt 0.318182 0.078731 -vt 0.363637 0.157461 -vt 0.909091 0.000000 -vt 0.954545 0.078731 -vt 0.863636 0.078731 -vt 0.727273 0.000000 -vt 0.772727 0.078731 -vt 0.681818 0.078731 -vt 0.545455 0.000000 -vt 0.590909 0.078731 -vt 0.500000 0.078731 -vt 0.318182 0.236191 -vt 0.090910 0.157461 -vt 0.181819 0.157461 -vt 0.136365 0.236191 -vt 0.818182 0.157461 -vt 0.909091 0.157461 -vt 0.863636 0.236191 -vt 0.636364 0.157461 -vt 0.727273 0.157461 -vt 0.681818 0.236191 -vt 0.454546 0.157461 -vt 0.545455 0.157461 -vt 0.500000 0.236191 -vt 0.227273 0.236191 -vt 0.045455 0.236191 -vt 0.772727 0.236191 -vt 0.590909 0.236191 -vt 0.409092 0.236191 -vt 0.181819 0.314921 -vt 0.272728 0.314921 -vt 0.227273 0.393651 -vt 0.000000 0.314921 -vt 0.090910 0.314921 -vt 0.045455 0.393651 -vt 0.727273 0.314921 -vt 0.818182 0.314921 -vt 0.772727 0.393651 -vt 0.545455 0.314921 -vt 0.636364 0.314921 -vt 0.590909 0.393651 -vt 0.363637 0.314921 -vt 0.454546 0.314921 -vt 0.409092 0.393651 -vt 0.500000 0.393651 -vt 0.454546 0.472382 -vt 0.681818 0.393651 -vt 0.636364 0.472382 -vt 0.863636 0.393651 -vt 0.818182 0.472382 -vt 0.909091 0.314921 -vt 0.136365 0.393651 -vt 0.090910 0.472382 -vt 0.318182 0.393651 -vt 0.272728 0.472382 -vt 0.954545 0.236191 -vt 1.000000 0.157461 -vt 0.409092 0.078731 -vt 0.363637 0.000000 -vt 0.660355 0.767678 -vt 0.566795 0.500000 -vt 0.660355 0.482322 -vt 0.629760 0.281278 -vt 0.566791 0.000000 -vt 0.566795 0.750000 -vt 0.634520 0.937445 -vt 0.817204 0.495240 -vt 0.400254 0.272695 -vt 0.400354 0.477620 -vt 0.624889 0.460309 -vt 0.562059 0.482339 -vt 0.558015 0.270056 -vt 0.606124 0.300096 -vt 0.566792 0.250000 -vt 0.875000 0.750000 -vt 0.875000 0.500000 -vt 0.625000 1.000000 -vt 0.566791 1.000000 -vt 0.817204 0.754760 -s 0 -usemtl Material -f 3/1/1 8/2/1 4/3/1 -f 7/4/2 6/5/2 8/6/2 -f 2/7/3 8/8/3 6/9/3 -f 1/10/4 4/3/4 2/7/4 -f 5/11/5 2/7/5 6/5/5 -f 9/12/6 22/13/6 21/14/6 -f 10/15/7 22/16/7 24/17/7 -f 9/18/8 21/19/8 26/20/8 -f 9/21/9 26/22/9 28/23/9 -f 9/24/10 28/25/10 25/26/10 -f 10/15/11 24/17/11 31/27/11 -f 11/28/12 23/29/12 33/30/12 -f 12/31/13 27/32/13 35/33/13 -f 13/34/14 29/35/14 37/36/14 -f 14/37/15 30/38/15 39/39/15 -f 10/15/16 31/27/16 34/40/16 -f 11/28/17 33/30/17 36/41/17 -f 12/31/18 35/33/18 38/42/18 -f 13/34/19 37/36/19 40/43/19 -f 14/37/20 39/39/20 32/44/20 -f 15/45/21 41/46/21 46/47/21 -f 16/48/22 42/49/22 48/50/22 -f 17/51/23 43/52/23 49/53/23 -f 18/54/24 44/55/24 50/56/24 -f 19/57/25 45/58/25 47/59/25 -f 47/59/26 50/60/26 20/61/26 -f 47/59/27 45/58/27 50/60/27 -f 45/58/28 18/54/28 50/60/28 -f 50/56/29 49/62/29 20/63/29 -f 50/56/30 44/55/30 49/62/30 -f 44/55/31 17/51/31 49/62/31 -f 49/53/32 48/64/32 20/65/32 -f 49/53/33 43/52/33 48/64/33 -f 43/52/34 16/66/34 48/64/34 -f 48/50/35 46/67/35 20/68/35 -f 48/50/36 42/49/36 46/67/36 -f 42/49/37 15/45/37 46/67/37 -f 46/47/38 47/69/38 20/70/38 -f 46/47/39 41/46/39 47/69/39 -f 41/46/40 19/57/40 47/69/40 -f 32/44/41 45/58/41 19/57/41 -f 32/44/42 39/39/42 45/58/42 -f 39/39/43 18/54/43 45/58/43 -f 40/43/44 44/55/44 18/54/44 -f 40/43/45 37/36/45 44/55/45 -f 37/36/46 17/51/46 44/55/46 -f 38/42/47 43/52/47 17/51/47 -f 38/42/48 35/33/48 43/52/48 -f 35/33/49 16/66/49 43/52/49 -f 36/41/50 42/49/50 16/48/50 -f 36/41/51 33/30/51 42/49/51 -f 33/30/52 15/45/52 42/49/52 -f 34/40/53 41/46/53 15/45/53 -f 34/40/54 31/27/54 41/46/54 -f 31/27/55 19/57/55 41/46/55 -f 39/39/56 40/43/56 18/54/56 -f 39/39/57 30/38/57 40/43/57 -f 30/38/58 13/34/58 40/43/58 -f 37/36/59 38/42/59 17/51/59 -f 37/36/60 29/35/60 38/42/60 -f 29/35/61 12/31/61 38/42/61 -f 35/33/62 36/71/62 16/66/62 -f 35/33/63 27/32/63 36/71/63 -f 27/32/64 11/72/64 36/71/64 -f 33/30/65 34/40/65 15/45/65 -f 33/30/66 23/29/66 34/40/66 -f 23/29/67 10/15/67 34/40/67 -f 31/27/68 32/44/68 19/57/68 -f 31/27/69 24/17/69 32/44/69 -f 24/17/70 14/37/70 32/44/70 -f 25/26/71 30/38/71 14/37/71 -f 25/26/72 28/25/72 30/38/72 -f 28/25/73 13/34/73 30/38/73 -f 28/23/74 29/35/74 13/34/74 -f 28/23/75 26/22/75 29/35/75 -f 26/22/76 12/31/76 29/35/76 -f 26/20/77 27/32/77 12/31/77 -f 26/20/78 21/19/78 27/32/78 -f 21/19/79 11/72/79 27/32/79 -f 24/17/80 25/73/80 14/37/80 -f 24/17/81 22/16/81 25/73/81 -f 22/16/82 9/74/82 25/73/82 -f 21/14/83 23/29/83 11/28/83 -f 21/14/84 22/13/84 23/29/84 -f 22/13/85 10/15/85 23/29/85 -f 63/7/3 51/8/3 64/9/3 -f 56/75/86 65/76/86 66/77/86 -f 65/76/4 53/3/4 63/7/4 -f 67/78/87 60/79/87 59/4/87 -f 55/80/1 59/81/1 51/2/1 -f 60/79/2 64/5/2 51/6/2 -f 67/82/88 56/75/88 66/77/88 -f 52/83/88 70/84/88 54/84/88 -f 54/84/5 64/5/5 52/83/5 -f 57/85/5 65/76/5 58/86/5 -f 54/84/5 65/76/5 63/7/5 -f 61/87/5 67/78/5 62/88/5 -f 52/83/5 68/89/5 61/87/5 -f 62/88/5 66/77/5 57/85/5 -f 73/87/5 71/85/5 70/84/5 -f 57/85/3 74/88/3 62/88/3 -f 61/87/89 74/88/89 73/87/89 -f 57/85/90 72/86/90 71/85/90 -f 52/83/4 73/87/4 69/83/4 -f 54/84/2 72/86/2 58/86/2 -f 7/90/88 1/10/88 5/91/88 -f 3/1/1 7/92/1 8/2/1 -f 7/4/2 5/11/2 6/5/2 -f 2/7/3 4/3/3 8/8/3 -f 1/10/4 3/1/4 4/3/4 -f 5/11/5 1/10/5 2/7/5 -f 63/7/3 53/3/3 51/8/3 -f 56/75/86 55/80/86 65/76/86 -f 65/76/4 55/80/4 53/3/4 -f 67/78/87 68/89/87 60/79/87 -f 51/2/1 53/3/1 55/80/1 -f 55/80/1 56/75/1 59/81/1 -f 59/81/1 60/93/1 51/2/1 -f 60/79/2 68/89/2 64/5/2 -f 67/82/88 59/94/88 56/75/88 -f 52/83/88 69/83/88 70/84/88 -f 54/84/5 63/7/5 64/5/5 -f 57/85/5 66/77/5 65/76/5 -f 54/84/5 58/86/5 65/76/5 -f 61/87/5 68/89/5 67/78/5 -f 52/83/5 64/5/5 68/89/5 -f 62/88/5 67/78/5 66/77/5 -f 70/84/5 69/83/5 73/87/5 -f 73/87/5 74/88/5 71/85/5 -f 71/85/5 72/86/5 70/84/5 -f 57/85/3 71/85/3 74/88/3 -f 61/87/89 62/88/89 74/88/89 -f 57/85/90 58/86/90 72/86/90 -f 52/83/4 61/87/4 73/87/4 -f 54/84/2 70/84/2 72/86/2 -f 7/90/88 3/1/88 1/10/88 diff --git a/simul/src/m3x3.rs b/simul/src/m3x3.rs deleted file mode 100644 index d6150d3..0000000 --- a/simul/src/m3x3.rs +++ /dev/null @@ -1,86 +0,0 @@ -use std::ops::{Mul, MulAssign}; - -use crate::v3::V3; - -#[derive(Clone, Copy, Debug)] -pub struct M3x3([[f64; 3]; 3]); - -impl M3x3 { - pub fn init(v: f64) -> Self { - Self([[v; 3]; 3]) - } - pub fn identity() -> Self { - Self([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]) - } - - pub fn new(v: [[f64; 3]; 3]) -> Self { - Self(v) - } - - pub fn from_v3_rot(rot: V3) -> Self { - M3x3::new_rotate_x(rot.0) * M3x3::new_rotate_y(rot.1) * M3x3::new_rotate_z(rot.2) - } - - #[rustfmt::skip] - pub fn new_rotate_x(angle: f64) -> Self { - Self([ - [1.0, 0.0, 0.0], - [0.0, f64::cos(angle), -f64::sin(angle)], - [0.0, f64::sin(angle), f64::cos(angle)], - ]) - } - - #[rustfmt::skip] - pub fn new_rotate_y(angle: f64) -> Self { - Self([ - [ f64::cos(angle), 0.0, f64::sin(angle)], - [ 0.0, 1.0, 0.0], - [-f64::sin(angle), 0.0, f64::cos(angle)], - ]) - } - - #[rustfmt::skip] - pub fn new_rotate_z(angle: f64) -> Self { - Self([ - [f64::cos(angle), -f64::sin(angle), 0.0], - [f64::sin(angle), f64::cos(angle), 0.0], - [ 0.0, 0.0, 1.0], - ]) - } -} - -impl Mul for M3x3 { - type Output = M3x3; - - fn mul(self, rhs: M3x3) -> Self::Output { - let mut output = M3x3([[0.0; 3]; 3]); - for i in 0..3 { - for j in 0..3 { - let v = &mut output.0[i][j]; - for k in 0..3 { - *v += self.0[i][k] * rhs.0[k][j]; - } - } - } - output - } -} - -impl Mul for M3x3 { - type Output = V3; - - fn mul(self, rhs: V3) -> Self::Output { - let V3(x, y, z) = rhs; - let [[xx, xy, xz], [yx, yy, yz], [zx, zy, zz]] = self.0; - V3( - x * xx + y * xy + z * xz, - x * yx + y * yy + z * yz, - x * zx + y * zy + z * zz, - ) - } -} -impl MulAssign for M3x3 { - fn mul_assign(&mut self, rhs: Self) { - *self = *self * rhs; - } -} diff --git a/simul/src/main.rs b/simul/src/main.rs deleted file mode 100644 index 70e2cc7..0000000 --- a/simul/src/main.rs +++ /dev/null @@ -1,237 +0,0 @@ -#![allow(unused)] - -use obj::{Obj, load_obj}; -use serde::Deserialize; -use std::{collections::HashMap, f64::consts::PI, fs::File, io::BufReader}; - -use crate::{ - m3x3::M3x3, - quats::RadianQuat, - scene::{Model, Scene}, - tri2::Tri2, - tri3::Tri3, - v2::V2, - v3::V3, - window::{Color, Event, Keycode, Renderer, Window}, -}; - -mod m3x3; -mod quats; -mod scene; -mod tri2; -mod tri3; -mod v2; -mod v3; -mod window; - -struct AssetStore { - assets: HashMap, -} - -impl AssetStore { - fn new() -> Self { - Self { - assets: HashMap::new(), - } - } - - fn load>(&mut self, path: S) -> Obj { - let path = path.into(); - if self.assets.contains_key(&path) { - return self.assets.get(&path).unwrap().clone(); - } - let asset: Obj = load_obj(BufReader::new(File::open(&path).unwrap())).unwrap(); - self.assets.insert(path, asset.clone()); - asset - } - - fn get>(&self, path: S) -> Option { - let path = path.into(); - self.assets.get(&path).cloned() - } -} - -pub struct App { - assets: AssetStore, - rot: V3, - motion_dev: MotionDevice, - dev_rot_rot: M3x3, - dev_accel_rot: M3x3, -} - -impl App { - pub fn new(motion_dev: MotionDevice) -> Self { - Self { - assets: AssetStore::new(), - rot: V3::init(0.0), - motion_dev, - dev_rot_rot: M3x3::identity(), - dev_accel_rot: M3x3::identity(), - } - } -} - -fn calculate_accel_axis_angle(axis: f64, tangent0: f64, tangent1: f64) -> f64 { - (axis / (tangent0 * tangent0 + tangent1 * tangent1).sqrt()).atan() -} - -impl window::App for App { - fn update(&mut self, delta_time: std::time::Duration) { - self.rot.0 += PI * 2.0 * delta_time.as_secs_f64() * 0.05; - // self.rot.2 += PI * 2.0 * delta_time.as_secs_f64() * 0.2; - - self.motion_dev - .update(delta_time.as_micros() as i64, |m, dt| { - self.dev_rot_rot *= M3x3::new_rotate_x(m.rotation().0 * dt); - self.dev_rot_rot *= M3x3::new_rotate_y(m.rotation().1 * dt); - self.dev_rot_rot *= M3x3::new_rotate_z(m.rotation().2 * dt); - - self.dev_accel_rot = M3x3::new_rotate_x(calculate_accel_axis_angle( - m.accel().0, - m.accel().1, - m.accel().2, - )); - self.dev_accel_rot *= M3x3::new_rotate_y(calculate_accel_axis_angle( - m.accel().1, - m.accel().0, - m.accel().2, - )); - }); - } - - fn render(&self, r: &mut R) { - let mut scene = Scene::new(); - - let mut cube = Model::new(); - let cube_obj = self.assets.get("assets/cube.obj").unwrap(); - cube.add_obj(&cube_obj, Color::RGB(165, 125, 165)) - .rotate_by_m3x3(self.dev_rot_rot) - .scale(V3(0.4, 0.4, 0.4)) - .translate(V3(0.0, 0.0, 1.0)); - scene.draw_model(cube); - - let probe_obj = self.assets.get("assets/probe.obj").unwrap(); - - let mut probe_rot = Model::new(); - probe_rot - .add_obj(&probe_obj, Color::RGB(100, 160, 100)) - .rotate_by_m3x3(M3x3::new_rotate_x(PI * 1.5)) - .rotate_by_m3x3(M3x3::new_rotate_y(PI)) - .rotate_by_m3x3(self.dev_rot_rot) - .scale(V3(0.15, 0.15, 0.15)) - .translate(V3(1.5, -0.8, 1.0)); - scene.draw_model(probe_rot); - let mut probe_accel = Model::new(); - probe_accel - .add_obj(&probe_obj, Color::RGB(160, 100, 100)) - .rotate_by_m3x3(M3x3::new_rotate_x(PI * 1.5)) - .rotate_by_m3x3(M3x3::new_rotate_y(PI)) - .rotate_by_m3x3(self.dev_accel_rot) - .scale(V3(0.15, 0.15, 0.15)) - .translate(V3(1.0, -0.8, 1.0)); - scene.draw_model(probe_accel); - - scene.render( - r, - V3(0.0, 0.0, -1.0), - M3x3::from_v3_rot(V3(0.0, 0.0, 0.0)), - V3(0.0, 0.0, 0.0), - ); - - let mut draw_v3 = |name: &str, v: V3, pos: V2| { - r.draw_text( - format!("{}: [{: >7.2}, {: >7.2}, {: >7.2}]", name, v.0, v.1, v.2).as_str(), - pos + V2(0.002, -0.002), - Color::BLACK, - ); - r.draw_text( - format!("{}: [{: >7.2}, {: >7.2}, {: >7.2}]", name, v.0, v.1, v.2).as_str(), - pos, - Color::WHITE, - ); - }; - - let m = self.motion_dev.current(); - draw_v3("acceleration", m.accel(), V2(-0.99, -0.5)); - draw_v3(" rotation", m.rotation(), V2(-0.99, -0.53)); - } - - fn event(&mut self, event: Event) {} -} - -#[derive(Debug, Deserialize)] -pub struct Measurement { - time_delta_us: i64, - accel_x: f64, - accel_y: f64, - accel_z: f64, - rotation_x: f64, - rotation_y: f64, - rotation_z: f64, -} - -impl Measurement { - pub fn accel(&self) -> V3 { - V3(self.accel_x, self.accel_y, self.accel_z) - } - - pub fn rotation(&self) -> V3 { - V3(self.rotation_x, self.rotation_y, self.rotation_z) - } -} - -pub struct MotionDevice { - measurements: Vec, - idx: usize, - timer_us: i64, -} - -impl MotionDevice { - pub fn new(measurements: Vec) -> Self { - Self { - measurements, - idx: 0, - timer_us: 0, - } - } - - pub fn update ()>(&mut self, delta_time_us: i64, mut func: F) { - self.timer_us += delta_time_us; - while self.timer_us >= self.measurements[self.idx].time_delta_us { - func( - &self.measurements[self.idx], - self.measurements[self.idx].time_delta_us as f64 / 1_000_000.0, - ); - self.timer_us -= self.measurements[self.idx].time_delta_us; - self.step(); - } - } - - fn step(&mut self) { - self.idx += 1; - if self.idx >= self.measurements.len() { - self.idx = 0; - } - } - - pub fn current(&self) -> &Measurement { - &self.measurements[self.idx] - } -} - -fn main() { - let mut reader = csv::Reader::from_path("assets/inputs_still.csv").unwrap(); - let mut measurements = Vec::::new(); - for entry in reader.deserialize::() { - let entry: Measurement = entry.unwrap(); - measurements.push(entry); - } - let motion_dev = MotionDevice::new(measurements); - - let mut window = Window::new(); - let mut app = App::new(motion_dev); - app.assets.load("assets/cube.obj"); - app.assets.load("assets/probe.obj"); - - window.run(&mut app); -} diff --git a/simul/src/quats.rs b/simul/src/quats.rs deleted file mode 100644 index 4ddf968..0000000 --- a/simul/src/quats.rs +++ /dev/null @@ -1,54 +0,0 @@ -use crate::v3::V3; - -const I: V3 = V3(1.0, 0.0, 0.0); -const J: V3 = V3(0.0, 1.0, 0.0); -const K: V3 = V3(0.0, 0.0, 1.0); - -#[derive(Copy, Clone)] -pub struct RadianQuat { - pub rad: f64, - pub u: V3, -} - -#[derive(Copy, Clone)] -pub struct Quat { - pub a: f64, - pub u: V3, -} - -impl Quat { - fn len(&self) -> f64 { - (self.a.powi(2) + self.u.0.powi(2) + self.u.1.powi(2) + self.u.2.powi(2)).sqrt() - } - fn as_unit(&self) -> Quat { - let len = self.len(); - Quat { - a: self.a / len, - u: self.u.map(|x| x / len), - } - } -} - -impl RadianQuat { - pub fn as_quat(&self) -> Quat { - let RadianQuat { rad, u } = self.as_unit(); - Quat { - a: rad.cos(), - u: u.map(|x| x * rad.sin()), - } - } - fn as_unit(&self) -> Self { - let len = self.u.0 + self.u.1 + self.u.2; - let u = self.u.map(|x| x / len); - - RadianQuat { rad: self.rad, u } - } - pub fn as_inverse_quat(&self) -> Quat { - let RadianQuat { rad, u } = self.as_unit(); - let u = u.map(|x| x * -1.0 * rad.sin()); - Quat { a: -rad.cos(), u } - } - pub fn vector_quat(&self) -> V3 { - self.u - } -} diff --git a/simul/src/scene.rs b/simul/src/scene.rs deleted file mode 100644 index 65dfa3c..0000000 --- a/simul/src/scene.rs +++ /dev/null @@ -1,171 +0,0 @@ -use std::f64::consts::PI; - -use obj::Obj; - -use crate::{ - m3x3::M3x3, - quats::RadianQuat, - tri2::Tri2, - tri3::Tri3, - v3::V3, - window::{Color, Renderer}, -}; - -pub struct Scene { - tris: Vec<(Tri3, V3, Color)>, -} - -impl Scene { - pub fn new() -> Self { - Self { tris: Vec::new() } - } - - pub fn render( - &self, - r: &mut impl Renderer, - camera_pos: V3, - camera_rot: M3x3, - screen_rel_pos: V3, - ) { - let mut indices_with_scores = self - .tris - .iter() - .enumerate() - .map(|(i, (tri, ..))| { - let mut score = (camera_pos - tri.middle()).len(); - (i, score) - }) - .rev() - .collect::>(); - - indices_with_scores.sort_by(|a, b| b.1.total_cmp(&a.1)); - - for (i, _) in indices_with_scores { - let (tri3, normal, color) = &self.tris[i]; - - // if !(tri3.0.2 >= -1.0 && tri3.1.2 >= -1.0 && tri3.2.2 >= -1.0) { - // continue; - // } - - if normal.dot(camera_pos - tri3.0) < 0.0 { - continue; - } - - let light = V3(1.0, 1.0, -1.0); - - let exposure = 1.5 - normal.angle(light) / PI; - - let (red, green, blue) = color.rgb(); - - let color = Color::RGB( - (red as f64 * exposure).clamp(0.0, 255.0) as _, - (green as f64 * exposure).clamp(0.0, 255.0) as _, - (blue as f64 * exposure).clamp(0.0, 255.0) as _, - ); - - let tri2 = tri3.project_2d(camera_pos, camera_rot, screen_rel_pos); - - r.draw_triangles(&[tri2], color); - // r.draw_line(tri2.0, tri2.1, Color::BLACK); - // r.draw_line(tri2.1, tri2.2, Color::BLACK); - // r.draw_line(tri2.2, tri2.0, Color::BLACK); - } - } - - pub fn draw_model(&mut self, model: Model) { - self.tris.extend(model.tris()); - } - - pub fn draw_triangle(&mut self, tri: Tri3, color: Color) { - self.tris.push((tri, tri.normal(), color)); - } -} - -pub struct Model { - tris: Vec<(Tri3, V3, Color)>, -} - -impl Model { - pub fn new() -> Self { - Self { tris: Vec::new() } - } - - pub fn tris(&self) -> impl Iterator { - self.tris.iter().copied() - } - - pub fn translate(&mut self, offset: V3) -> &mut Self { - for tri in &mut self.tris { - tri.0 = tri.0.translate(offset); - } - self - } - - pub fn rotate_by_m3x3(&mut self, rot: M3x3) -> &mut Self { - for tri in &mut self.tris { - tri.0 = tri.0.rotate_by_m3x3(rot); - tri.1 = tri.1.rotate_by_m3x3(rot); - } - self - } - - pub fn rotate_by_quat(&mut self, rot: RadianQuat) -> &mut Self { - for tri in &mut self.tris { - tri.0 = tri.0.rotate_by_quat(rot); - tri.1 = tri.1.rotate_by_quat(rot); - } - self - } - - pub fn scale(&mut self, scale: V3) -> &mut Self { - for tri in &mut self.tris { - tri.0 = tri.0.scale(scale); - } - self - } - - pub fn add_tri(&mut self, tri: Tri3, color: Color) -> &mut Self { - self.tris.push((tri, tri.normal(), color)); - self - } - - pub fn add_obj(&mut self, obj: &Obj, color: Color) -> &mut Self { - // if our triangle definition convention is [0, 1, 2] - // obj's is [2, 1, 0]. - // - // likewise, if our coordinate system is [x, y, z], - // obj's is [x, z, y]. - - let count = obj.indices.len() / 3; - for i in 0..count { - let v2 = obj.vertices[obj.indices[i * 3] as usize]; - let v1 = obj.vertices[obj.indices[i * 3 + 1] as usize]; - let v0 = obj.vertices[obj.indices[i * 3 + 2] as usize]; - - let tri = Tri3( - V3( - v0.position[0] as _, - v0.position[2] as _, - v0.position[1] as _, - ), - V3( - v1.position[0] as _, - v1.position[2] as _, - v1.position[1] as _, - ), - V3( - v2.position[0] as _, - v2.position[2] as _, - v2.position[1] as _, - ), - ); - - let normal = V3(v0.normal[0] as _, v0.normal[2] as _, v0.normal[1] as _) - + V3(v1.normal[0] as _, v1.normal[2] as _, v1.normal[1] as _) - + V3(v2.normal[0] as _, v2.normal[2] as _, v2.normal[1] as _); - - self.tris.push((tri, normal, color)); - } - self - } -} diff --git a/simul/src/tri2.rs b/simul/src/tri2.rs deleted file mode 100644 index 2ae4925..0000000 --- a/simul/src/tri2.rs +++ /dev/null @@ -1,4 +0,0 @@ -use crate::v2::V2; - -#[derive(Clone, Copy, Debug)] -pub struct Tri2(pub V2, pub V2, pub V2); diff --git a/simul/src/tri3.rs b/simul/src/tri3.rs deleted file mode 100644 index 0a88cf8..0000000 --- a/simul/src/tri3.rs +++ /dev/null @@ -1,60 +0,0 @@ -use crate::{m3x3::M3x3, quats::RadianQuat, tri2::Tri2, v3::V3}; - -#[derive(Clone, Copy, Debug)] -pub struct Tri3(pub V3, pub V3, pub V3); - -impl Tri3 { - pub fn init(v: V3) -> Self { - Self(v, v, v) - } - - pub fn map V3>(&self, func: F) -> Self { - Self(func(self.0), func(self.1), func(self.2)) - } - - pub fn zip V3>(&self, rhs: Tri3, func: F) -> Self { - Self( - func(self.0, rhs.0), - func(self.1, rhs.1), - func(self.2, rhs.2), - ) - } - - pub fn rotate_by_v3(&self, rot: V3) -> Self { - self.map(|v| v.rotate_by_v3(rot)) - } - pub fn rotate_by_m3x3(&self, rot: M3x3) -> Self { - self.map(|v| v.rotate_by_m3x3(rot)) - } - pub fn rotate_by_quat(&self, rot: RadianQuat) -> Self { - self.map(|v| v.rotate_by_quat(rot)) - } - - pub fn project_2d(&self, camera_pos: V3, camera_rot: M3x3, screen_rel_pos: V3) -> Tri2 { - Tri2( - self.0.project_2d(camera_pos, camera_rot, screen_rel_pos), - self.1.project_2d(camera_pos, camera_rot, screen_rel_pos), - self.2.project_2d(camera_pos, camera_rot, screen_rel_pos), - ) - } - - pub fn translate(&self, offset: V3) -> Self { - self.map(|v| v.translate(offset)) - } - - pub fn scale(&self, scale: V3) -> Self { - self.map(|v| v.scale(scale)) - } - - pub fn points(&self) -> [V3; 3] { - [self.0, self.1, self.2] - } - - pub fn normal(&self) -> V3 { - (self.1 - self.0).cross(self.2 - self.1) - } - - pub fn middle(&self) -> V3 { - (self.0 + self.1 + self.2).map(|v| v / 3.0) - } -} diff --git a/simul/src/v2.rs b/simul/src/v2.rs deleted file mode 100644 index 916d0d8..0000000 --- a/simul/src/v2.rs +++ /dev/null @@ -1,84 +0,0 @@ -use std::ops::{Add, Div, Mul, Neg, Sub}; - -#[derive(Clone, Copy, Debug)] -pub struct V2(pub f64, pub f64); - -impl V2 { - pub fn init(v: f64) -> Self { - Self(v, v) - } - - pub fn map f64>(&self, func: F) -> Self { - Self(func(self.0), func(self.1)) - } - - pub fn zip f64>(&self, rhs: Self, func: F) -> Self { - Self(func(self.0, rhs.0), func(self.1, rhs.1)) - } - - pub fn iter(&self) -> impl Iterator { - [self.0, self.1].into_iter() - } - - pub fn reduce f64>(&self, initial: f64, func: F) -> f64 { - let acc = initial; - let acc = func(acc, self.0); - func(acc, self.1) - } - - pub fn normal(&self) -> V2 { - V2(-self.1, self.0) - } - - pub fn translate(&self, trans: V2) -> V2 { - *self + trans - } - - pub fn len(&self) -> f64 { - self.map(|v| v.powi(2)).reduce(0.0, |acc, v| acc + v) - } - - pub fn unit(&self) -> V2 { - *self / self.len() - } -} - -impl Add for V2 { - type Output = V2; - - fn add(self, rhs: V2) -> Self::Output { - self.zip(rhs, |a, b| a + b) - } -} - -impl Sub for V2 { - type Output = V2; - - fn sub(self, rhs: V2) -> Self::Output { - self.zip(rhs, |a, b| a - b) - } -} - -impl Mul for V2 { - type Output = V2; - - fn mul(self, rhs: f64) -> Self::Output { - self.map(|v| v * rhs) - } -} - -impl Div for V2 { - type Output = V2; - - fn div(self, rhs: f64) -> Self::Output { - self.map(|v| v / rhs) - } -} - -impl Neg for V2 { - type Output = V2; - - fn neg(self) -> Self::Output { - V2::init(0.0) - self - } -} diff --git a/simul/src/v3.rs b/simul/src/v3.rs deleted file mode 100644 index 4a93da7..0000000 --- a/simul/src/v3.rs +++ /dev/null @@ -1,141 +0,0 @@ -use crate::{ - m3x3::M3x3, - quats::{Quat, RadianQuat}, - v2::V2, -}; -use std::ops::{Add, Div, Mul, Neg, Sub}; - -#[derive(Clone, Copy, Debug)] -pub struct V3(pub f64, pub f64, pub f64); - -impl V3 { - pub fn init(v: f64) -> Self { - Self(v, v, v) - } - - pub fn map f64>(&self, func: F) -> Self { - Self(func(self.0), func(self.1), func(self.2)) - } - - pub fn zip f64>(&self, rhs: V3, func: F) -> Self { - Self( - func(self.0, rhs.0), - func(self.1, rhs.1), - func(self.2, rhs.2), - ) - } - - pub fn iter(&self) -> impl Iterator { - [self.0, self.1, self.2].into_iter() - } - - pub fn reduce f64>(&self, initial: f64, func: F) -> f64 { - let mut acc = initial; - for v in self.iter() { - acc = func(acc, v); - } - acc - } - - pub fn cross(&self, rhs: V3) -> Self { - let V3(ax, ay, az) = self; - let V3(bx, by, bz) = rhs; - V3(ay * bz - az * by, az * bx - ax * bz, ax * by - ay * bx) - } - - pub fn rotate_by_v3(&self, rot: V3) -> Self { - M3x3::new_rotate_z(rot.2) - * (M3x3::new_rotate_y(rot.1) * (M3x3::new_rotate_x(rot.0) * *self)) - } - - pub fn rotate_by_quat(&self, rot: RadianQuat) -> Self { - let u = rot.vector_quat(); - let theta = rot.rad; - let q_real = theta.cos(); - let q_vector = u * theta.sin(); - let p = *self; - - let r = p - + (u.cross(p)) * 2.0 * theta.cos() * theta.sin() - + (u * 2.0 * theta.sin().powi(2)).cross(u.cross(p)); - r - } - - pub fn rotate_by_m3x3(&self, rot: M3x3) -> Self { - rot * *self - } - - /// See https://en.wikipedia.org/wiki/3D_projection#Mathematical_formula - /// for details on the implementation. - pub fn project_2d(&self, camera_pos: V3, camera_rot: M3x3, screen_rel_pos: V3) -> V2 { - let a = *self; - let c = camera_pos; - let d = (a - c).rotate_by_m3x3(camera_rot); - let e = screen_rel_pos - c; - V2(e.2 / d.2 * d.0 + e.0, e.2 / d.2 * d.1 + e.1) - } - - pub fn angle(&self, rhs: Self) -> f64 { - (self.dot(rhs) / (self.len() * rhs.len())).acos() - } - - pub fn dot(&self, rhs: Self) -> f64 { - self.zip(rhs, |a, b| a * b).reduce(0.0, |acc, v| acc + v) - } - - pub fn translate(&self, offset: Self) -> Self { - *self + offset - } - - pub fn scale(&self, scale: Self) -> Self { - self.zip(scale, |a, b| a * b) - } - - pub fn len(&self) -> f64 { - self.map(|v| v.powi(2)).reduce(0.0, |acc, v| acc + v).sqrt() - } - - pub fn unit(&self) -> V3 { - *self / self.len() - } -} - -impl Add for V3 { - type Output = V3; - - fn add(self, rhs: V3) -> Self::Output { - self.zip(rhs, |a, b| a + b) - } -} - -impl Sub for V3 { - type Output = V3; - - fn sub(self, rhs: V3) -> Self::Output { - self.zip(rhs, |a, b| a - b) - } -} - -impl Mul for V3 { - type Output = V3; - - fn mul(self, rhs: f64) -> Self::Output { - self.map(|v| v * rhs) - } -} - -impl Div for V3 { - type Output = V3; - - fn div(self, rhs: f64) -> Self::Output { - self.map(|v| v / rhs) - } -} - -impl Neg for V3 { - type Output = V3; - - fn neg(self) -> Self::Output { - V3::init(0.0) - self - } -} diff --git a/simul/src/window.rs b/simul/src/window.rs deleted file mode 100644 index b4c17e1..0000000 --- a/simul/src/window.rs +++ /dev/null @@ -1,196 +0,0 @@ -use std::time::{Duration, Instant}; - -use sdl3::{ - Sdl, - event::Event as SdlEvent, - render::{Canvas, FPoint, FRect, TextureQuery, Vertex, VertexIndices}, - ttf::Font, - video::Window as SdlWindow, -}; - -pub use sdl3::{keyboard::Keycode, pixels::Color}; - -use crate::{tri2::Tri2, v2::V2}; - -pub static WIDTH: f64 = 1920.0; -pub static HEIGHT: f64 = 1080.0; - -pub trait App { - fn update(&mut self, delta_time: Duration); - fn render(&self, r: &mut R); - fn event(&mut self, event: Event); -} - -pub trait Renderer { - fn draw_rect(&mut self, pos: V2, size: V2, color: Color); - fn draw_line(&mut self, from: V2, to: V2, color: Color); - fn draw_triangles(&mut self, tris: &[Tri2], color: Color); - fn draw_text(&mut self, text: &str, pos: V2, color: Color); -} - -pub enum Event { - KeyDown(Keycode), - KeyUp(Keycode), -} - -pub struct Window { - sdl_cx: Sdl, - canvas: Canvas, - font: Box>, -} - -impl Window { - pub fn new() -> Self { - let sdl_cx = sdl3::init().unwrap(); - let ttf_cx = sdl3::ttf::init().unwrap(); - - let video_subsystem = sdl_cx.video().unwrap(); - let window = video_subsystem - .window("Game", WIDTH as u32, HEIGHT as u32) - .position_centered() - .build() - .unwrap(); - let mut canvas = window.into_canvas(); - - let font = Box::new( - ttf_cx - .load_font("/usr/share/fonts/TTF/FiraCode-Medium.ttf", 20.0) - .unwrap(), - ); - - canvas.set_draw_color(Color::BLACK); - canvas.clear(); - canvas.present(); - - Self { - sdl_cx, - canvas, - font, - } - } - - pub fn run(&mut self, app: &mut impl App) { - let mut event_pump = self.sdl_cx.event_pump().unwrap(); - - let mut time_before = Instant::now(); - let time_per_frame = Duration::from_secs_f64(1.0 / 60.0); - let mut print_fps_timer = Instant::now(); - let mut fps_count = 0; - - 'running: loop { - for event in event_pump.poll_iter() { - match event { - SdlEvent::Quit { .. } - | SdlEvent::KeyDown { - keycode: Some(Keycode::Escape), - .. - } => break 'running, - SdlEvent::KeyDown { - keycode: Some(key), .. - } => app.event(Event::KeyDown(key)), - SdlEvent::KeyUp { - keycode: Some(key), .. - } => app.event(Event::KeyUp(key)), - _ => {} - } - } - - let time_now = Instant::now(); - let delta_time = time_now - time_before; - time_before = time_now; - app.update(delta_time); - - self.canvas.set_draw_color(Color::RGB(30, 30, 30)); - self.canvas.clear(); - app.render(self); - self.canvas.present(); - - fps_count += 1; - if (time_now - print_fps_timer).as_secs_f64() > 1.0 { - println!("fps: {fps_count}"); - fps_count = 0; - print_fps_timer = time_now; - } - if delta_time < time_per_frame { - std::thread::sleep(time_per_frame - delta_time); - } - } - } - - fn scale_w2s(&self, v: V2) -> V2 { - let factor = WIDTH / 2.0; - V2(v.0 * factor, v.1 * factor) - } - fn translate_w2s(&self, v: V2) -> V2 { - let aspect_ratio_h2w = HEIGHT / WIDTH; - let middle = V2(1.0, 1.0 * aspect_ratio_h2w); - V2(v.0 + middle.0, middle.1 - v.1) - } - fn point_w2s(&self, v: V2) -> V2 { - self.scale_w2s(self.translate_w2s(v)) - } -} - -impl Renderer for Window { - fn draw_rect(&mut self, pos: V2, size: V2, color: Color) { - let size = self.scale_w2s(size); - let pos = self.point_w2s(pos).translate(V2(0.0, -size.0)); - self.canvas.set_draw_color(color); - self.canvas - .fill_rect(FRect::new(pos.0 as _, pos.1 as _, size.0 as _, size.1 as _)) - .unwrap(); - } - fn draw_line(&mut self, from: V2, to: V2, color: Color) { - self.canvas.set_draw_color(color); - self.canvas - .draw_line(self.point_w2s(from), self.point_w2s(to)) - .unwrap(); - } - - fn draw_triangles(&mut self, tris: &[Tri2], color: Color) { - let vertices = tris - .iter() - .flat_map(|t| [t.0, t.1, t.2]) - .map(|p| self.point_w2s(p)) - .map(|p| Vertex { - position: p.into(), - color: color.into(), - tex_coord: FPoint::new(0.0, 0.0), - }) - .collect::>(); - - self.canvas - .render_geometry(&vertices, None, VertexIndices::Sequential) - .unwrap(); - } - - fn draw_text(&mut self, text: &str, pos: V2, color: Color) { - let texture_creator = self.canvas.texture_creator(); - - let surface = self.font.render(text).blended(color).unwrap(); - let texture = texture_creator - .create_texture_from_surface(&surface) - .unwrap(); - - let TextureQuery { width, height, .. } = texture.query(); - - let pos = self.point_w2s(pos); - - self.canvas.copy( - &texture, - None, - FRect { - x: pos.0 as _, - y: pos.1 as _, - w: width as _, - h: height as _, - }, - ); - } -} - -impl From for FPoint { - fn from(value: V2) -> Self { - FPoint::new(value.0 as _, value.1 as _) - } -}