From 992e997e89d40805065df406be811d984695fb49 Mon Sep 17 00:00:00 2001 From: kion Date: Thu, 11 Jul 2024 17:31:15 +0900 Subject: [PATCH] add obj files --- index.ts | 28 + obj/01_HEAD_FACE.obj | 80 +++ obj/01_HEAD_HAIR.obj | 610 +++++++++++++++++++ obj/01_HEAD_MOUTH.obj | 63 ++ obj/02_BODY.obj | 207 +++++++ obj/03_HIPS.obj | 146 +++++ obj/04_RIGHT_SHOULDER.obj | 95 +++ obj/05_RIGHT_ARM.obj | 49 ++ obj/06_RIGHT_HAND.obj | 80 +++ obj/07_LEFT_SHOULDER.obj | 93 +++ obj/08_LEFT_ARM.obj | 49 ++ obj/09_LEFT_HAND.obj | 80 +++ obj/10_LEG_RIGHT_TOP.obj | 50 ++ obj/11_LEG_RIGHT_BOTTOM.obj | 55 ++ obj/12_RIGHT_FOOT.obj | 89 +++ obj/13_LEG_LEFT_TOP.obj | 50 ++ obj/14_LEG_LEFT_BOTTOM.obj | 56 ++ obj/15_LEFT_FOOT.obj | 89 +++ src/Encode.ts | 1131 +++++++++++++++++++++++++++++++++++ src/index.ts | 1 - 20 files changed, 3100 insertions(+), 1 deletion(-) create mode 100644 index.ts create mode 100644 obj/01_HEAD_FACE.obj create mode 100644 obj/01_HEAD_HAIR.obj create mode 100644 obj/01_HEAD_MOUTH.obj create mode 100644 obj/02_BODY.obj create mode 100644 obj/03_HIPS.obj create mode 100644 obj/04_RIGHT_SHOULDER.obj create mode 100644 obj/05_RIGHT_ARM.obj create mode 100644 obj/06_RIGHT_HAND.obj create mode 100644 obj/07_LEFT_SHOULDER.obj create mode 100644 obj/08_LEFT_ARM.obj create mode 100644 obj/09_LEFT_HAND.obj create mode 100644 obj/10_LEG_RIGHT_TOP.obj create mode 100644 obj/11_LEG_RIGHT_BOTTOM.obj create mode 100644 obj/12_RIGHT_FOOT.obj create mode 100644 obj/13_LEG_LEFT_TOP.obj create mode 100644 obj/14_LEG_LEFT_BOTTOM.obj create mode 100644 obj/15_LEFT_FOOT.obj create mode 100644 src/Encode.ts delete mode 100644 src/index.ts diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..0bb8849 --- /dev/null +++ b/index.ts @@ -0,0 +1,28 @@ +import { doReplace } from './src/Encode'; + +doReplace( + "Miku/miku_body.png", + "Miku/miku_face.png", + // Body Encoding + "Miku/02_BODY.obj", + "Miku/03_HIPS.obj", + "Miku/10_LEG_RIGHT_TOP.obj", + "Miku/11_LEG_RIGHT_BOTTOM.obj", + "Miku/13_LEG_LEFT_TOP.obj", + "Miku/14_LEG_LEFT_BOTTOM.obj", + // Feet + "Miku/12_RIGHT_FOOT.obj", + "Miku/15_LEFT_FOOT.obj", + // Left Arm + "Miku/07_LEFT_SHOULDER.obj", + "Miku/08_LEFT_ARM.obj", + "Miku/09_LEFT_HAND.obj", + // Right Arm + "Miku/04_RIGHT_SHOULDER.obj", + "Miku/05_RIGHT_ARM.obj", + "Miku/06_RIGHT_HAND.obj", + // Head + "Miku/01_HEAD_HAIR.obj", + "Miku/01_HEAD_FACE.obj", + "Miku/01_HEAD_MOUTH.obj" +) \ No newline at end of file diff --git a/obj/01_HEAD_FACE.obj b/obj/01_HEAD_FACE.obj new file mode 100644 index 0000000..6de97bc --- /dev/null +++ b/obj/01_HEAD_FACE.obj @@ -0,0 +1,80 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 01_HEAD_FACE +v -0.071191 0.039905 0.107424 +v -0.105101 0.057420 0.064305 +v -0.105460 0.044096 0.073482 +v -0.011404 0.036430 0.134149 +v 0.071191 0.039905 0.107424 +v 0.105101 0.057420 0.064305 +v 0.105460 0.044096 0.073482 +v 0.011404 0.036430 0.134149 +v 0.000000 0.056607 0.121125 +v -0.071191 0.052976 0.101514 +v 0.071191 0.052976 0.101514 +v 0.011219 0.190246 0.126499 +v 0.000000 0.147186 0.136466 +v -0.075874 0.146425 0.106575 +v 0.075874 0.146425 0.106575 +v -0.117114 0.128671 0.040457 +v -0.048941 0.183664 0.109518 +v 0.117114 0.128671 0.040457 +vn -0.3580 0.3847 0.8508 +vn -0.6872 0.2993 0.6620 +vn -0.5924 0.4677 0.6559 +vn 0.3580 0.3847 0.8508 +vn 0.6872 0.2993 0.6620 +vn 0.5924 0.4677 0.6559 +vn -0.2379 0.6181 0.7492 +vn 0.2379 0.6181 0.7492 +vn -0.3651 -0.0686 0.9284 +vn -0.2892 0.2867 0.9133 +vn -0.7415 -0.0733 0.6670 +vn 0.2544 -0.1615 0.9535 +vn 0.3650 0.1187 0.9234 +vn 0.7415 -0.0733 0.6670 +vn -0.3616 0.1893 0.9129 +vn -0.8518 0.0314 0.5229 +vn 0.8518 0.0314 0.5229 +vn -0.2544 -0.1615 0.9535 +vn 0.3651 -0.0686 0.9284 +vt 0.049890 0.883963 +vt 0.049890 0.870147 +vt 0.113084 0.866475 +vt 0.014047 0.888660 +vt 0.013668 0.874578 +vt 0.137191 0.866475 +vt 0.200386 0.870147 +vt 0.200386 0.883963 +vt 0.236228 0.888660 +vt 0.236608 0.874578 +vt 0.125138 0.887802 +vt 0.125138 0.983542 +vt 0.044939 0.982738 +vt 0.139709 0.999990 +vt 0.076120 0.999234 +vt 0.205336 0.982738 +vt 0.001350 0.963972 +vt 0.248926 0.963972 +s 0 +usemtl m2 +f 10/1/1 1/2/1 4/3/1 +f 10/1/2 2/4/2 1/2/2 +f 2/4/3 3/5/3 1/2/3 +f 8/6/4 5/7/4 11/8/4 +f 11/8/5 5/7/5 6/9/5 +f 6/9/6 5/7/6 7/10/6 +f 9/11/7 10/1/7 4/3/7 +f 9/11/8 8/6/8 11/8/8 +f 13/12/9 14/13/9 10/1/9 +f 12/14/10 17/15/10 13/12/10 +f 2/4/11 10/1/11 14/13/11 +f 13/12/12 9/11/12 11/8/12 +f 15/16/13 12/14/13 13/12/13 +f 15/16/14 11/8/14 6/9/14 +f 17/15/15 14/13/15 13/12/15 +f 16/17/16 2/4/16 14/13/16 +f 18/18/17 15/16/17 6/9/17 +f 9/11/18 13/12/18 10/1/18 +f 15/16/19 13/12/19 11/8/19 diff --git a/obj/01_HEAD_HAIR.obj b/obj/01_HEAD_HAIR.obj new file mode 100644 index 0000000..0ede984 --- /dev/null +++ b/obj/01_HEAD_HAIR.obj @@ -0,0 +1,610 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 01_HEAD_HAIR +v -0.000000 0.004875 -0.025325 +v 0.000000 -0.023992 0.099085 +v 0.011219 0.190246 0.126499 +v 0.000000 0.267372 0.074026 +v 0.079510 0.269148 -0.039717 +v 0.000000 0.229239 -0.123117 +v 0.000000 0.156565 -0.152198 +v -0.000000 0.066003 -0.114308 +v -0.042993 0.231703 -0.131809 +v -0.138597 0.182075 -0.027743 +v -0.102081 0.144630 -0.119834 +v -0.079510 0.269148 -0.039717 +v -0.063728 -0.001677 0.080054 +v -0.069400 0.033082 -0.081999 +v -0.120163 0.128670 -0.051034 +v -0.094361 0.039259 -0.053008 +v -0.102013 0.039259 0.038483 +v -0.105101 0.057420 0.064305 +v -0.105460 0.044096 0.073482 +v 0.042993 0.231703 -0.131809 +v 0.138597 0.182075 -0.027743 +v 0.102081 0.144630 -0.119834 +v 0.063728 -0.001677 0.080054 +v 0.069400 0.033082 -0.081999 +v 0.120163 0.128670 -0.051034 +v 0.094361 0.039259 -0.053008 +v 0.102013 0.039259 0.038483 +v 0.105101 0.057420 0.064305 +v 0.075874 0.146425 0.106575 +v 0.105460 0.044096 0.073482 +v -0.050134 0.186678 0.137617 +v -0.088772 0.102346 0.123744 +v -0.076599 -0.007868 0.119680 +v 0.020894 0.095637 0.156114 +v 0.002185 0.184235 0.145671 +v 0.105894 0.024950 0.140259 +v -0.117114 0.128670 0.040457 +v -0.124333 0.220223 0.052279 +v 0.130210 0.136987 0.082725 +v 0.110294 0.259784 0.073392 +v 0.068114 0.230585 0.136956 +v -0.110811 0.033666 0.081418 +v -0.127564 0.104300 0.110164 +v -0.101023 0.214276 0.112904 +v -0.101115 0.277458 0.079144 +v -0.061119 0.266495 0.087371 +v 0.004738 0.283355 0.088694 +v -0.083775 0.092211 0.090485 +v -0.048941 0.183664 0.109518 +v -0.107557 0.230221 0.046554 +v 0.107557 0.230221 0.046554 +v 0.092230 -0.018384 0.098946 +v 0.117114 0.128670 0.040457 +v -0.152754 0.124581 -0.046936 +v -0.137653 0.035170 -0.048911 +v -0.140921 0.124581 0.043570 +v -0.125820 0.035170 0.041596 +v -0.128866 0.062912 0.066435 +v -0.270318 0.071588 -0.125575 +v -0.383622 -0.550705 -0.361310 +v -0.270318 0.109132 -0.279233 +v -0.125366 -0.562113 -0.220697 +v -0.167590 0.068551 -0.144241 +v -0.115704 -0.543132 -0.391434 +v -0.146803 0.109132 -0.277793 +v -0.166592 -0.213009 -0.422565 +v -0.356591 -0.213890 -0.267126 +v -0.095700 -0.228558 -0.306790 +v -0.211115 0.234040 -0.160705 +v -0.272207 -0.543132 -0.450845 +v -0.252230 -0.541938 -0.173826 +v -0.305211 -0.205151 -0.383721 +v -0.075446 0.249871 -0.152799 +v -0.172972 0.201403 -0.050063 +v -0.136063 0.163737 -0.141880 +v -0.112356 0.287536 -0.060982 +v -0.106685 0.221985 -0.131574 +v -0.260045 -0.813289 -0.310541 +v -0.228966 -0.763982 -0.246878 +v 0.152754 0.124581 -0.046936 +v 0.137653 0.035170 -0.048911 +v 0.140921 0.124581 0.043570 +v 0.125820 0.035170 0.041596 +v 0.128866 0.062912 0.066435 +v 0.270318 0.071588 -0.125575 +v 0.383622 -0.550705 -0.361310 +v 0.270318 0.109132 -0.279233 +v 0.125366 -0.562113 -0.220697 +v 0.167590 0.068551 -0.144241 +v 0.115704 -0.543132 -0.391434 +v 0.146803 0.109132 -0.277793 +v 0.166592 -0.213009 -0.422565 +v 0.356591 -0.213890 -0.267126 +v 0.095700 -0.228558 -0.306790 +v 0.211115 0.234040 -0.160705 +v 0.272207 -0.543132 -0.450845 +v 0.252230 -0.541938 -0.173826 +v 0.305211 -0.205151 -0.383721 +v 0.075446 0.249871 -0.152799 +v 0.172972 0.201403 -0.050063 +v 0.136063 0.163737 -0.141880 +v 0.112356 0.287536 -0.060982 +v 0.106685 0.221985 -0.131574 +v 0.260045 -0.813289 -0.310541 +v 0.228966 -0.763982 -0.246878 +v -0.142209 0.040352 0.118252 +v -0.158794 0.149383 0.105159 +v -0.135722 0.228541 0.101064 +vn 0.1208 0.9354 -0.3324 +vn -0.3097 0.0799 -0.9475 +vn -0.2639 -0.9396 -0.2180 +vn -0.2402 -0.3742 -0.8957 +vn -0.2271 -0.9538 -0.1966 +vn -0.0000 0.9999 0.0156 +vn -0.8284 0.5599 -0.0167 +vn -0.3761 0.8843 0.2767 +vn 0.2046 0.3637 -0.9088 +vn -0.9179 -0.2582 -0.3012 +vn -0.9405 -0.3383 0.0313 +vn -0.9363 -0.1960 -0.2915 +vn -0.4240 -0.8885 -0.1757 +vn -0.9354 0.0672 0.3473 +vn -0.7403 -0.6720 0.0200 +vn -0.9950 -0.0371 -0.0929 +vn -0.9056 0.2094 0.3688 +vn 0.1264 -0.8176 -0.5617 +vn -0.7348 -0.4009 -0.5472 +vn -0.2392 -0.3748 -0.8957 +vn -0.6988 -0.7129 -0.0584 +vn -0.1208 0.9354 -0.3324 +vn 0.3097 0.0799 -0.9475 +vn 0.2639 -0.9396 -0.2180 +vn 0.2402 -0.3742 -0.8957 +vn 0.2271 -0.9538 -0.1966 +vn -0.0000 0.9020 -0.4317 +vn 0.8284 0.5599 -0.0167 +vn 0.3761 0.8843 0.2767 +vn -0.2046 0.3637 -0.9088 +vn 0.9179 -0.2582 -0.3012 +vn 0.9405 -0.3383 0.0313 +vn 0.9363 -0.1960 -0.2915 +vn 0.4240 -0.8885 -0.1757 +vn 0.9354 0.0672 0.3473 +vn 0.7403 -0.6720 0.0200 +vn 0.9950 -0.0371 -0.0929 +vn -0.1264 -0.8176 -0.5617 +vn 0.7348 -0.4009 -0.5472 +vn 0.2392 -0.3748 -0.8957 +vn 0.6988 -0.7129 -0.0584 +vn 0.1064 0.0355 0.9937 +vn 0.7698 0.1514 0.6201 +vn -0.2328 0.4892 0.8405 +vn -0.1477 0.0850 0.9854 +vn -0.3328 -0.0714 0.9403 +vn -0.3788 0.0480 0.9242 +vn -0.9843 -0.0560 -0.1672 +vn -0.8547 -0.3563 0.3775 +vn -0.9689 -0.1494 -0.1975 +vn -0.0292 0.5296 0.8477 +vn -0.1704 0.4642 0.8692 +vn 0.2572 0.8020 0.5391 +vn 0.8957 -0.4076 0.1777 +vn 0.9877 0.1048 0.1164 +vn -0.5385 0.5270 -0.6575 +vn 0.6320 -0.1749 -0.7550 +vn 0.7224 -0.2328 -0.6511 +vn 0.8488 0.2351 0.4736 +vn -0.5723 -0.3474 -0.7428 +vn -0.4269 -0.3381 -0.8387 +vn -0.7912 -0.6108 0.0319 +vn 0.3055 0.5122 -0.8027 +vn -0.1633 0.6929 -0.7023 +vn -0.1356 0.8121 -0.5675 +vn 0.0417 0.6688 -0.7423 +vn 0.0418 0.6695 -0.7417 +vn 0.9590 0.1367 -0.2483 +vn 0.7824 0.1724 0.5984 +vn -0.3695 0.0903 -0.9249 +vn -0.1481 0.5122 0.8460 +vn 0.4015 -0.0025 0.9158 +vn 0.9369 -0.2541 -0.2403 +vn 0.9435 0.1076 -0.3135 +vn -0.8542 -0.0609 -0.5164 +vn -0.5886 -0.6497 -0.4810 +vn -0.9674 -0.2195 0.1265 +vn -0.9812 -0.1442 0.1283 +vn -0.1421 0.9898 0.0116 +vn 0.1128 0.3476 0.9308 +vn 0.1207 -0.9927 -0.0028 +vn -0.1071 -0.0025 -0.9942 +vn -0.0887 -0.6698 0.7372 +vn -0.9636 0.2597 0.0635 +vn 0.0106 0.4093 -0.9123 +vn 0.9728 0.1308 0.1912 +vn 0.1763 -0.0720 0.9817 +vn 0.9281 -0.3710 0.0317 +vn 0.8548 0.0835 -0.5122 +vn 0.8897 -0.4565 -0.0004 +vn -0.7848 -0.2607 0.5622 +vn 0.2780 -0.6218 -0.7322 +vn 0.9248 0.0158 0.3801 +vn 0.2608 0.7283 -0.6337 +vn -0.7194 0.5586 0.4128 +vn -0.9050 0.1804 -0.3853 +vn -0.8131 -0.0953 0.5743 +vn 0.2955 -0.2705 0.9162 +vn -0.5567 -0.4025 -0.7267 +vn -0.6275 0.0923 -0.7731 +vn 0.9959 -0.0762 0.0479 +vn -0.9248 0.0158 0.3801 +vn -0.2373 0.3301 -0.9136 +vn 0.0085 0.6862 -0.7274 +vn -0.9297 0.3577 0.0874 +vn 0.1306 -0.5698 0.8113 +vn 0.2628 0.7175 -0.6451 +vn 0.7682 -0.3492 0.5365 +vn 0.3547 -0.0334 -0.9344 +vn 0.8503 0.1714 -0.4976 +vn -0.8976 0.2255 -0.3787 +vn -0.2575 0.1640 -0.9523 +vn -0.9791 -0.1679 0.1150 +vn -0.3566 0.3604 0.8619 +vn -0.5451 -0.8296 0.1212 +vn 0.5438 0.8303 -0.1220 +vn 0.3564 -0.3602 -0.8621 +vn -0.7420 0.4605 -0.4872 +vn -0.7807 -0.0718 0.6207 +vn 0.7194 0.5586 0.4128 +vn -0.9893 -0.1273 0.0719 +vn 0.9974 0.0075 -0.0720 +vn 0.2110 -0.7875 0.5791 +vn 0.9674 -0.2195 0.1265 +vn 0.9812 -0.1442 0.1283 +vn 0.1421 0.9898 0.0116 +vn -0.1128 0.3476 0.9308 +vn -0.1207 -0.9927 -0.0028 +vn 0.1071 -0.0025 -0.9942 +vn 0.0887 -0.6698 0.7372 +vn 0.9636 0.2597 0.0635 +vn -0.0106 0.4093 -0.9123 +vn -0.9728 0.1308 0.1912 +vn -0.1763 -0.0720 0.9817 +vn -0.9281 -0.3710 0.0317 +vn -0.8548 0.0835 -0.5122 +vn -0.8897 -0.4565 -0.0004 +vn 0.7848 -0.2607 0.5622 +vn -0.2780 -0.6218 -0.7322 +vn -0.3323 -0.0916 0.9387 +vn -0.2608 0.7283 -0.6337 +vn 0.8295 0.3890 0.4007 +vn 0.9050 0.1804 -0.3853 +vn 0.8131 -0.0953 0.5743 +vn -0.2955 -0.2705 0.9162 +vn 0.5567 -0.4025 -0.7267 +vn 0.6275 0.0923 -0.7731 +vn -0.9959 -0.0762 0.0479 +vn 0.2373 0.3301 -0.9136 +vn -0.0085 0.6862 -0.7274 +vn 0.9297 0.3577 0.0874 +vn -0.1306 -0.5698 0.8113 +vn -0.2628 0.7175 -0.6451 +vn -0.7682 -0.3492 0.5365 +vn -0.3547 -0.0334 -0.9344 +vn -0.8503 0.1714 -0.4976 +vn 0.8976 0.2255 -0.3787 +vn 0.2575 0.1640 -0.9523 +vn 0.9791 -0.1679 0.1150 +vn 0.3566 0.3604 0.8619 +vn 0.5451 -0.8296 0.1212 +vn -0.5438 0.8303 -0.1220 +vn -0.3564 -0.3602 -0.8621 +vn 0.7420 0.4605 -0.4872 +vn 0.7807 -0.0718 0.6207 +vn 0.9893 -0.1273 0.0719 +vn -0.9974 0.0075 -0.0720 +vn -0.2110 -0.7875 0.5791 +vn -0.1092 0.4975 0.8606 +vn 0.3323 -0.0916 0.9387 +vn 0.9019 -0.2249 -0.3688 +vn -0.2231 0.0827 0.9713 +vn -0.6877 -0.1888 -0.7010 +vn -0.1067 0.4685 0.8770 +vn -0.8386 0.4697 -0.2759 +vn -0.9303 0.2576 -0.2611 +vn -0.2725 0.1287 0.9535 +vn -0.8295 0.3890 0.4007 +vt 0.226563 0.128906 +vt 0.238281 0.101562 +vt 0.277344 0.085937 +vt 0.203125 0.128906 +vt 0.214844 0.062500 +vt 0.015625 0.078125 +vt 0.105469 0.128906 +vt 0.015625 0.128906 +vt 0.148438 0.078125 +vt 0.343750 0.128906 +vt 0.277344 0.171875 +vt 0.265625 0.039062 +vt 0.320313 0.050781 +vt 0.144531 0.031250 +vt 0.246094 0.019531 +vt 0.304688 0.000000 +vt 0.015625 0.031250 +vt 0.035156 0.031250 +vt 0.015625 0.007812 +vt 0.054688 0.945312 +vt 0.027344 0.964844 +vt 0.027344 0.875000 +vt 0.160156 0.128906 +vt 0.132812 0.906250 +vt 0.191406 0.832031 +vt 0.160156 0.937500 +vt 0.203125 0.890625 +vt 0.125000 0.976562 +vt 0.117188 0.839844 +vt 0.085938 0.910156 +vt 0.050781 0.800781 +vt 0.050781 0.863281 +vt 0.000000 0.937500 +vt 0.000000 0.843750 +vt 0.089844 0.960937 +vt 0.058594 0.976562 +vt 0.183594 0.968750 +vt 0.784050 0.265719 +vt 0.784050 0.267214 +vt 0.781360 0.263627 +vt 0.782855 0.263328 +vt 0.781360 0.258845 +vt 0.023438 0.984375 +vt 0.787005 0.260369 +vt 0.784119 0.263736 +vt 0.784119 0.257002 +vt 0.787005 0.267584 +vt 0.786441 0.261834 +vt 0.788234 0.266317 +vt 0.787636 0.266915 +vt 0.789430 0.260041 +vt 0.781958 0.260041 +vt 0.785245 0.258248 +vt 0.786142 0.256753 +vt 0.066406 1.000000 +vt 0.058594 0.980469 +vt 0.125000 0.984375 +vt 0.199219 0.976562 +vt 0.125000 0.781250 +vt 0.156250 0.781250 +vt 0.101562 0.851562 +vt 0.101562 0.781250 +vt 0.226562 0.914062 +vt 0.782257 0.257351 +vt 0.785245 0.257351 +vt 0.785245 0.262731 +vt 0.781958 0.258248 +vt 0.070312 0.472656 +vt 0.050781 0.441899 +vt 0.152344 0.472656 +vt 0.152344 0.394531 +vt 0.070313 0.394531 +vt 0.804688 0.312500 +vt 0.730469 0.312500 +vt 0.730469 0.281250 +vt 0.804688 0.281250 +vt 0.847656 0.312500 +vt 0.847656 0.281250 +vt 0.648438 0.312500 +vt 0.574219 0.312500 +vt 0.574219 0.281250 +vt 0.648438 0.281250 +vt 0.890625 0.281250 +vt 0.449219 0.863281 +vt 0.378906 0.863281 +vt 0.468750 0.691406 +vt 0.304688 0.863281 +vt 0.335938 0.691406 +vt 0.203125 0.863281 +vt 0.277344 0.683594 +vt 0.539062 0.863281 +vt 0.585938 0.546875 +vt 0.289062 0.941406 +vt 0.289062 0.523437 +vt 0.230469 0.523437 +vt 0.230469 0.398438 +vt 0.585938 0.546875 +vt 0.476562 0.546875 +vt 0.542969 0.394531 +vt 0.378906 0.523437 +vt 0.343750 0.398438 +vt 0.359375 0.941406 +vt 0.370020 0.995273 +vt 0.412808 0.949038 +vt 0.402344 0.695312 +vt 0.468750 0.691406 +vt 0.156250 0.523438 +vt 0.476562 0.941406 +vt 0.718750 0.722656 +vt 0.785156 0.722656 +vt 0.785156 0.750000 +vt 0.718750 0.750000 +vt 0.656250 0.750000 +vt 0.656250 0.722656 +vt 0.851562 0.722656 +vt 0.851562 0.750000 +vt 0.917969 0.722656 +vt 0.917969 0.750000 +vt 0.570313 0.257812 +vt 0.554688 0.285156 +vt 0.503906 0.257812 +vt 0.570313 0.324219 +vt 0.370020 0.995273 +vt 0.412808 0.949038 +vt 0.734375 0.640625 +vt 0.734375 0.718750 +vt 0.656250 0.640625 +vt 0.656250 0.718750 +vt 0.890625 0.312500 +vt 0.781958 0.261834 +vt 0.789430 0.260041 +vt 0.101562 0.757812 +vt 0.155605 0.787875 +vt 0.058594 0.781250 +vt 0.058594 0.734375 +vt 0.153382 0.752782 +vt 0.027344 0.757812 +vt 0.058594 0.757812 +s 0 +usemtl m0 +f 6/1/1 9/2/1 12/3/1 +f 7/4/2 11/5/2 9/2/2 +f 13/6/3 1/7/3 2/8/3 +f 14/9/4 11/5/4 7/4/4 +f 1/7/5 13/6/5 14/9/5 +f 4/10/6 5/11/6 12/3/6 +f 10/12/7 50/13/7 12/3/7 +f 50/13/8 4/10/8 12/3/8 +f 6/1/9 7/4/9 9/2/9 +f 16/14/10 15/15/10 11/5/10 +f 10/12/11 15/15/11 37/16/11 +f 11/5/12 15/15/12 10/12/12 +f 13/6/13 16/14/13 14/9/13 +f 50/13/14 10/12/14 37/16/14 +f 13/6/15 19/17/15 17/18/15 +f 18/19/16 17/18/16 19/17/16 +f 44/20/17 38/21/17 43/22/17 +f 8/23/18 1/7/18 14/9/18 +f 14/9/19 16/14/19 11/5/19 +f 8/23/20 14/9/20 7/4/20 +f 17/18/21 16/14/21 13/6/21 +f 5/3/22 20/2/22 6/1/22 +f 7/4/23 20/2/23 22/5/23 +f 23/6/24 2/8/24 1/7/24 +f 24/9/25 7/4/25 22/5/25 +f 1/7/26 24/9/26 23/6/26 +f 5/11/27 6/1/27 12/3/27 +f 21/12/28 5/3/28 51/13/28 +f 51/13/29 5/3/29 4/10/29 +f 6/1/30 20/2/30 7/4/30 +f 26/14/31 22/5/31 25/15/31 +f 21/12/32 53/16/32 25/15/32 +f 22/5/33 21/12/33 25/15/33 +f 23/6/34 24/9/34 26/14/34 +f 51/13/35 53/16/35 21/12/35 +f 23/6/36 27/18/36 30/17/36 +f 28/19/37 30/17/37 27/18/37 +f 8/23/38 24/9/38 1/7/38 +f 24/9/39 22/5/39 26/14/39 +f 8/23/40 7/4/40 24/9/40 +f 27/18/41 23/6/41 26/14/41 +f 35/24/42 36/25/42 41/26/42 +f 36/25/43 39/27/43 41/26/43 +f 41/26/44 47/28/44 35/24/44 +f 34/29/45 35/24/45 31/30/45 +f 33/31/46 32/32/46 43/22/46 +f 44/20/47 43/22/47 32/32/47 31/30/47 +f 38/21/48 37/33/48 43/22/48 +f 42/34/49 33/31/49 43/22/49 +f 37/33/50 42/34/50 43/22/50 +f 31/30/51 46/35/51 45/36/51 +f 44/20/52 31/30/52 45/36/52 +f 41/26/53 40/37/53 47/28/53 +f 49/38/54 31/39/54 32/40/54 48/41/54 +f 33/42/55 48/41/55 32/40/55 +f 45/36/56 50/43/56 38/21/56 +f 42/44/57 48/45/57 33/46/57 +f 37/47/58 48/45/58 42/44/58 +f 34/48/59 3/49/59 35/50/59 +f 36/51/60 35/52/60 29/53/60 +f 39/54/61 36/51/61 29/53/61 +f 31/39/62 49/38/62 34/48/62 +f 46/35/63 50/55/63 45/56/63 +f 46/35/64 47/28/64 4/57/64 +f 50/55/65 46/35/65 4/57/65 +f 47/28/66 40/37/66 4/57/66 +f 51/58/67 4/57/67 40/37/67 +f 39/27/68 51/58/68 40/37/68 +f 39/27/69 40/37/69 41/26/69 +f 38/21/70 50/43/70 37/33/70 +f 31/30/71 47/28/71 46/35/71 +f 39/59/72 29/60/72 52/61/72 +f 39/59/73 52/61/73 53/62/73 +f 51/58/74 39/27/74 53/63/74 +f 29/64/75 53/65/75 52/66/75 +f 29/53/76 35/52/76 3/67/76 +f 57/68/77 58/69/77 55/70/77 +f 54/71/78 58/69/78 56/72/78 +f 37/73/79 15/74/79 54/75/79 56/76/79 +f 18/77/80 37/73/80 56/76/80 58/78/80 +f 16/79/81 17/80/81 57/81/81 55/82/81 +f 15/74/82 16/79/82 55/82/82 54/75/82 +f 18/77/83 58/78/83 57/83/83 +f 59/84/84 61/85/84 67/86/84 +f 61/85/85 65/87/85 66/88/85 +f 65/87/86 63/89/86 68/90/86 +f 63/91/87 59/84/87 71/92/87 +f 63/89/88 65/87/88 77/93/88 +f 64/94/89 66/88/89 68/90/89 +f 64/94/90 62/95/90 79/96/90 +f 71/97/91 60/98/91 78/99/91 +f 70/100/92 64/94/92 79/101/92 +f 68/90/93 63/89/93 62/95/93 +f 65/87/94 69/102/94 77/93/94 +f 76/103/95 69/102/95 74/104/95 +f 60/98/96 67/86/96 72/105/96 +f 60/98/97 71/97/97 67/106/97 +f 62/95/98 71/107/98 79/96/98 +f 60/98/99 70/100/99 78/99/99 +f 60/98/100 72/105/100 70/100/100 +f 62/95/101 64/94/101 68/90/101 +f 89/89/102 94/90/102 88/95/102 +f 61/85/103 66/88/103 72/105/103 +f 65/87/104 61/85/104 69/102/104 +f 61/85/105 59/84/105 69/102/105 +f 59/84/106 63/91/106 74/104/106 +f 77/93/107 69/102/107 76/103/107 +f 74/104/108 63/91/108 77/108/108 +f 64/94/109 70/100/109 66/88/109 +f 66/88/110 65/87/110 68/90/110 +f 67/86/111 61/85/111 72/105/111 +f 72/105/112 66/88/112 70/100/112 +f 55/70/113 58/69/113 54/71/113 +f 10/109/114 12/110/114 76/111/114 74/112/114 +f 10/109/115 74/112/115 75/113/115 11/114/115 +f 12/110/116 9/115/116 73/116/116 76/111/116 +f 11/117/117 75/118/117 73/116/117 9/115/117 +f 73/119/118 77/120/118 76/121/118 +f 75/122/118 77/120/118 73/119/118 +f 71/92/119 59/84/119 67/106/119 +f 95/102/120 102/123/120 100/124/120 +f 79/125/121 71/126/121 70/127/121 +f 71/126/122 78/128/122 70/127/122 +f 17/129/123 18/77/123 57/83/123 +f 83/68/124 81/70/124 84/69/124 +f 80/71/125 82/72/125 84/69/125 +f 53/73/126 82/76/126 80/75/126 25/74/126 +f 28/77/127 84/78/127 82/76/127 53/73/127 +f 26/79/128 81/82/128 83/81/128 27/80/128 +f 25/74/129 80/75/129 81/82/129 26/79/129 +f 28/77/130 83/83/130 84/78/130 +f 85/84/131 93/86/131 87/85/131 +f 87/85/132 92/88/132 91/87/132 +f 91/87/133 94/90/133 89/89/133 +f 89/91/134 97/97/134 85/84/134 +f 89/89/135 103/93/135 91/87/135 +f 90/94/136 94/90/136 92/88/136 +f 90/94/137 105/96/137 88/95/137 +f 97/97/138 104/99/138 86/98/138 +f 96/100/139 105/101/139 90/94/139 +f 97/107/140 89/89/140 88/95/140 +f 91/87/141 103/93/141 95/102/141 +f 85/84/142 95/102/142 100/124/142 +f 86/98/143 98/105/143 93/86/143 +f 86/98/144 93/86/144 97/97/144 +f 88/95/145 105/96/145 97/107/145 +f 86/98/146 104/99/146 96/100/146 +f 86/98/147 96/100/147 98/105/147 +f 88/95/148 94/90/148 90/94/148 +f 87/85/149 98/105/149 92/88/149 +f 91/87/150 95/102/150 87/85/150 +f 87/85/151 95/102/151 85/84/151 +f 85/84/152 100/124/152 89/91/152 +f 103/93/153 102/123/153 95/102/153 +f 100/124/154 103/108/154 89/91/154 +f 90/94/155 92/88/155 96/100/155 +f 92/88/156 94/90/156 91/87/156 +f 93/86/157 98/105/157 87/85/157 +f 98/105/158 96/100/158 92/88/158 +f 81/70/159 80/71/159 84/69/159 +f 21/109/160 100/112/160 102/111/160 5/110/160 +f 21/109/161 22/114/161 101/113/161 100/112/161 +f 5/110/162 102/111/162 99/116/162 20/115/162 +f 22/117/163 20/115/163 99/116/163 101/118/163 +f 99/119/164 102/121/164 103/120/164 +f 101/122/164 99/119/164 103/120/164 +f 97/97/165 93/86/165 85/84/165 +f 105/125/166 96/127/166 97/126/166 +f 97/126/167 96/127/167 104/128/167 +f 27/129/168 83/83/168 28/77/168 +f 47/28/169 31/30/169 35/24/169 +f 63/89/170 71/107/170 62/95/170 +f 38/130/171 44/52/171 106/131/171 +f 107/132/172 106/133/172 44/134/172 +f 38/135/173 106/136/173 107/132/173 +f 45/137/174 108/138/174 44/134/174 +f 45/137/175 38/135/175 108/138/175 +f 108/138/176 38/135/176 107/132/176 +f 108/138/177 107/132/177 44/134/177 +f 69/102/178 59/84/178 74/104/178 diff --git a/obj/01_HEAD_MOUTH.obj b/obj/01_HEAD_MOUTH.obj new file mode 100644 index 0000000..1cfabbb --- /dev/null +++ b/obj/01_HEAD_MOUTH.obj @@ -0,0 +1,63 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 01_HEAD_MOUTH +v 0.000000 -0.023992 0.099085 +v 0.000000 0.047794 0.141450 +v -0.063728 -0.001677 0.080054 +v -0.071191 0.039905 0.107424 +v -0.105460 0.044096 0.073482 +v -0.011404 0.036430 0.134149 +v -0.070407 0.019621 0.099426 +v 0.063728 -0.001677 0.080054 +v 0.071191 0.039905 0.107424 +v 0.105460 0.044096 0.073482 +v 0.011404 0.036430 0.134149 +v 0.070407 0.019621 0.099426 +v 0.000000 0.056607 0.121125 +vn -0.6914 -0.2880 0.6625 +vn -0.3183 -0.5200 0.7926 +vn -0.7599 0.5964 0.2586 +vn -0.7050 -0.5853 0.4004 +vn -0.4180 -0.6795 0.6030 +vn -0.3992 -0.3496 0.8476 +vn 0.6914 -0.2880 0.6625 +vn 0.3183 -0.5200 0.7926 +vn 0.7599 0.5964 0.2586 +vn -0.0000 -0.5406 0.8413 +vn 0.7050 -0.5853 0.4004 +vn 0.4180 -0.6795 0.6030 +vn 0.3992 -0.3496 0.8476 +vn -0.0000 -0.5019 0.8649 +vt 0.050719 0.848707 +vt 0.049890 0.870147 +vt 0.013668 0.874578 +vt 0.125138 0.802610 +vt 0.113084 0.866475 +vt 0.125138 0.871822 +vt 0.125138 0.887802 +vt 0.057778 0.826196 +vt 0.199557 0.848707 +vt 0.236608 0.874578 +vt 0.200386 0.870147 +vt 0.137191 0.866475 +vt 0.248696 0.801572 +vt 0.236642 0.829220 +vt 0.224588 0.801572 +vt 0.192497 0.826196 +s 0 +usemtl m2 +f 7/1/1 4/2/1 5/3/1 +f 7/1/2 1/4/2 6/5/2 +f 2/6/3 13/7/3 6/5/3 +f 3/8/4 7/1/4 5/3/4 +f 3/8/5 1/4/5 7/1/5 +f 4/2/6 7/1/6 6/5/6 +f 12/9/7 10/10/7 9/11/7 +f 12/9/8 11/12/8 1/4/8 +f 2/6/9 11/12/9 13/7/9 +f 11/13/10 2/14/10 6/15/10 +f 8/16/11 10/10/11 12/9/11 +f 8/16/12 12/9/12 1/4/12 +f 9/11/13 11/12/13 12/9/13 +f 1/4/14 11/12/14 6/5/14 diff --git a/obj/02_BODY.obj b/obj/02_BODY.obj new file mode 100644 index 0000000..5597221 --- /dev/null +++ b/obj/02_BODY.obj @@ -0,0 +1,207 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 02_BODY +v -0.095711 0.257487 0.015865 +v -0.071650 0.229049 -0.114372 +v -0.079496 0.069259 0.050391 +v 0.000000 0.294575 -0.107941 +v -0.065114 0.260097 0.037793 +v 0.000000 0.074467 0.106397 +v 0.000000 0.074467 -0.048386 +v -0.088380 0.068285 -0.000231 +v -0.105838 0.302589 -0.064499 +v -0.095398 0.172499 0.058446 +v -0.065954 0.175602 0.098419 +v -0.044145 0.346871 -0.058264 +v 0.000000 0.314836 -0.011222 +v 0.000000 0.382541 -0.000116 +v 0.000000 0.340606 -0.086888 +v -0.050542 0.401029 -0.054656 +v 0.000000 0.408284 -0.088637 +v -0.086884 0.307885 -0.065653 +v 0.000000 0.312338 0.043633 +v 0.095711 0.257487 0.015865 +v 0.071650 0.229049 -0.114372 +v 0.079496 0.069259 0.050391 +v 0.088380 0.068285 -0.000231 +v 0.105838 0.302589 -0.064499 +v 0.065114 0.260097 0.037793 +v 0.095398 0.172499 0.058446 +v 0.044145 0.346871 -0.058264 +v 0.050542 0.401029 -0.054656 +v 0.086884 0.307885 -0.065653 +v 0.065954 0.175602 0.098419 +v -0.013513 0.260740 0.040408 +v -0.024328 0.175439 0.109320 +v 0.013513 0.260740 0.040408 +v 0.024328 0.175439 0.109320 +v -0.055533 -0.042895 0.170847 +v 0.055533 -0.042895 0.170847 +v 0.000000 -0.077127 0.171105 +vn -0.7840 0.2757 0.5561 +vn -0.3281 0.8190 0.4708 +vn 0.3095 -0.2484 -0.9179 +vn -0.3153 0.4279 -0.8471 +vn -0.7875 -0.1676 0.5931 +vn -0.9822 0.0812 0.1694 +vn -0.3846 -0.5074 -0.7711 +vn -0.9712 -0.1631 0.1736 +vn -0.5569 -0.0105 -0.8305 +vn -0.7549 -0.1175 0.6452 +vn -0.5461 -0.0216 -0.8375 +vn -0.9118 -0.1704 -0.3737 +vn -0.2328 0.6822 -0.6931 +vn 0.9118 -0.1704 -0.3737 +vn -0.6485 0.6299 0.4275 +vn 0.5603 0.8274 0.0377 +vn -0.3906 0.5658 -0.7262 +vn -0.3543 0.3889 -0.8504 +vn -0.5387 -0.2889 0.7915 +vn -0.5332 0.4967 0.6848 +vn -0.5762 0.6651 0.4750 +vn 0.7840 0.2757 0.5561 +vn 0.3281 0.8190 0.4708 +vn -0.3095 -0.2484 -0.9179 +vn 0.3153 0.4279 -0.8471 +vn 0.7875 -0.1676 0.5931 +vn 0.9822 0.0812 0.1694 +vn 0.3846 -0.5074 -0.7711 +vn 0.9712 -0.1631 0.1736 +vn 0.5569 -0.0105 -0.8305 +vn 0.7549 -0.1175 0.6452 +vn 0.5461 -0.0216 -0.8375 +vn 0.9974 -0.0720 0.0085 +vn 0.2328 0.6822 -0.6931 +vn 0.6485 0.6299 0.4275 +vn -0.5603 0.8274 0.0377 +vn 0.3906 0.5658 -0.7262 +vn 0.3543 0.3889 -0.8504 +vn -0.0000 -0.1111 0.9938 +vn -0.0000 0.5830 0.8125 +vn -0.0000 0.0786 0.9969 +vn 0.5387 -0.2889 0.7915 +vn 0.5332 0.4967 0.6848 +vn 0.5762 0.6651 0.4750 +vn -0.0000 0.0075 1.0000 +vn -0.0000 0.6284 0.7779 +vn -0.9974 -0.0720 0.0085 +vn -0.0000 0.2712 0.9625 +vt 0.152344 0.312500 +vt 0.171875 0.312500 +vt 0.152344 0.367187 +vt 0.171875 0.367187 +vt 0.171875 0.441406 +vt 0.152344 0.441406 +vt 0.437500 0.257812 +vt 0.500000 0.371094 +vt 0.437500 0.410156 +vt 0.500000 0.421875 +vt 0.152344 0.250000 +vt 0.144531 0.250000 +vt 0.125000 0.355469 +vt 0.500000 0.257812 +vt 0.054688 0.367187 +vt 0.070313 0.386719 +vt 0.527344 1.000000 +vt 0.527344 0.960937 +vt 0.554688 0.960937 +vt 0.488281 1.000000 +vt 0.488281 0.960937 +vt 0.554688 1.000000 +vt 0.089844 0.250000 +vt 0.492188 0.425781 +vt 0.375000 0.367187 +vt 0.339844 0.250000 +vt 0.285156 0.250000 +vt 0.003906 0.433594 +vt 0.003906 0.496094 +vt 0.042969 0.433594 +vt 0.042969 0.496094 +vt 0.070312 0.496094 +vt 0.042969 0.378906 +vt 0.003906 0.378906 +vt 0.214844 0.250000 +vt 0.277344 0.312500 +vt 0.277344 0.367187 +vt 0.257813 0.312500 +vt 0.257813 0.367187 +vt 0.277344 0.441406 +vt 0.257812 0.441406 +vt 0.375000 0.371094 +vt 0.375000 0.421875 +vt 0.277344 0.250000 +vt 0.304688 0.355469 +vt 0.375000 0.257812 +vt 0.359375 0.386719 +vt 0.449219 1.000000 +vt 0.417969 0.960937 +vt 0.449219 0.960937 +vt 0.417969 1.000000 +vt 0.382812 0.425781 +vt 0.003906 0.324219 +vt 0.042969 0.324219 +vt 0.003906 0.261719 +vt 0.070313 0.261719 +vt 0.042969 0.261719 +vt 0.214844 0.398437 +vt 0.679688 0.097656 +vt 0.679688 0.156250 +vt 0.660156 0.128906 +vt 0.878906 0.097656 +vt 1.000000 0.097656 +vt 1.000000 0.156250 +vt 0.878906 0.156250 +vt 0.835938 0.097656 +vt 0.835938 0.156250 +s 0 +usemtl m0 +f 10/1/1 11/2/1 1/3/1 +f 5/4/2 18/5/2 9/6/2 1/3/2 +f 7/7/3 2/8/3 4/9/3 +f 4/9/4 2/8/4 9/10/4 +f 3/11/5 11/2/5 10/1/5 +f 1/1/6 9/12/6 10/13/6 +f 7/7/7 8/14/7 2/8/7 +f 8/15/8 3/16/8 10/13/8 +f 12/17/9 16/18/9 17/19/9 +f 12/17/10 13/20/10 14/21/10 16/18/10 +f 15/22/11 12/17/11 17/19/11 +f 2/23/12 8/15/12 9/12/12 +f 4/9/13 9/10/13 18/24/13 +f 23/25/14 21/26/14 24/27/14 +f 18/28/15 5/29/15 12/30/15 +f 12/30/16 19/31/16 13/32/16 +f 15/33/17 18/28/17 12/30/17 +f 4/34/18 18/28/18 15/33/18 +f 3/11/19 6/35/19 11/2/19 +f 11/2/20 5/4/20 1/3/20 +f 12/30/21 5/29/21 19/31/21 +f 26/36/22 20/37/22 30/38/22 +f 25/39/23 20/37/23 24/40/23 29/41/23 +f 7/7/24 4/9/24 21/42/24 +f 4/9/25 24/43/25 21/42/25 +f 22/44/26 26/36/26 30/38/26 +f 20/36/27 26/45/27 24/27/27 +f 7/7/28 21/42/28 23/46/28 +f 23/25/29 26/45/29 22/47/29 +f 27/48/30 17/49/30 28/50/30 +f 27/48/31 28/50/31 14/21/31 13/20/31 +f 15/51/32 17/49/32 27/48/32 +f 26/45/33 23/25/33 24/27/33 +f 4/9/34 29/52/34 24/43/34 +f 29/53/35 27/54/35 25/55/35 +f 27/54/36 13/56/36 19/57/36 +f 15/33/37 27/54/37 29/53/37 +f 4/34/38 15/33/38 29/53/38 +f 25/39/39 19/58/39 5/4/39 +f 11/2/40 25/39/40 5/4/40 +f 30/38/40 25/39/40 11/2/40 +f 6/35/41 30/38/41 11/2/41 +f 22/44/42 30/38/42 6/35/42 +f 30/38/43 20/37/43 25/39/43 +f 27/54/44 19/57/44 25/55/44 +f 36/59/45 35/60/45 37/61/45 +f 34/62/46 33/63/46 31/64/46 32/65/46 +f 8/15/47 10/13/47 9/12/47 +f 34/66/48 32/67/48 35/60/48 36/59/48 diff --git a/obj/03_HIPS.obj b/obj/03_HIPS.obj new file mode 100644 index 0000000..dca5940 --- /dev/null +++ b/obj/03_HIPS.obj @@ -0,0 +1,146 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 03_HIPS +v -0.167275 -0.160999 0.132434 +v -0.167275 -0.137852 -0.124934 +v -0.079496 0.069259 0.050391 +v -0.000000 -0.161159 -0.167173 +v -0.000000 -0.196372 0.155870 +v 0.000000 0.074467 0.106397 +v 0.000000 0.074467 -0.048386 +v -0.251402 -0.100596 0.000000 +v -0.181524 -0.039160 0.000000 +v -0.220969 -0.035692 0.000000 +v -0.088380 0.068285 -0.000231 +v -0.120065 -0.047983 0.106934 +v -0.109567 -0.034297 -0.109403 +v -0.120486 -0.026447 0.126141 +v 0.167275 -0.160999 0.132434 +v 0.167275 -0.137852 -0.124934 +v 0.079496 0.069259 0.050391 +v 0.251402 -0.100596 0.000000 +v 0.181524 -0.039160 0.000000 +v 0.220969 -0.035692 0.000000 +v 0.088380 0.068285 -0.000231 +v 0.120065 -0.047983 0.106934 +v 0.109567 -0.034297 -0.109403 +v 0.120486 -0.026447 0.126141 +vn -0.4593 0.6639 0.5902 +vn -0.1773 -0.9792 -0.0985 +vn -0.6040 0.6870 0.4039 +vn -0.0819 0.2518 0.9643 +vn -0.0875 -0.9957 -0.0319 +vn 0.5593 -0.5457 0.6241 +vn -0.4979 -0.8638 -0.0777 +vn -0.0871 -0.9910 -0.1013 +vn -0.5253 0.6686 -0.5263 +vn -0.3742 0.7110 -0.5954 +vn -0.6129 0.6971 -0.3721 +vn -0.2032 0.2550 -0.9454 +vn -0.0000 0.4893 -0.8721 +vn -0.6538 -0.5107 0.5583 +vn -0.6143 0.7836 0.0928 +vn 0.4593 0.6639 0.5902 +vn 0.1773 -0.9792 -0.0985 +vn 0.6040 0.6870 0.4039 +vn 0.0819 0.2518 0.9643 +vn -0.0000 0.0044 1.0000 +vn 0.0875 -0.9957 -0.0319 +vn -0.5593 -0.5457 0.6241 +vn 0.4979 -0.8638 -0.0777 +vn 0.0871 -0.9910 -0.1013 +vn 0.5253 0.6686 -0.5263 +vn 0.3742 0.7110 -0.5954 +vn 0.6671 0.4597 -0.5863 +vn 0.2032 0.2550 -0.9454 +vn 0.6538 -0.5107 0.5583 +vn 0.6294 0.6298 0.4552 +vn -0.0000 0.3132 0.9497 +vn -0.0000 0.4144 -0.9101 +vn -0.6684 0.4180 0.6152 +vn 0.6684 0.4180 0.6152 +vn -0.6671 0.4597 -0.5863 +vn 0.6129 0.6971 -0.3721 +vn -0.6294 0.6298 0.4552 +vn 0.6143 0.7836 0.0928 +vn -0.0732 0.9973 -0.0063 +vn 0.0732 0.9973 -0.0063 +vn -0.0000 0.9986 0.0527 +vn -0.0000 0.9957 -0.0926 +vt 0.019531 0.136719 +vt 0.074219 0.136719 +vt 0.019531 0.218750 +vt 0.054688 0.503906 +vt 0.152344 0.480469 +vt 0.152344 0.667969 +vt 0.054688 0.652344 +vt 0.867188 0.246094 +vt 0.781250 0.246094 +vt 0.781250 0.156250 +vt 0.867188 0.156250 +vt 0.933594 0.156250 +vt 0.085938 0.218750 +vt 0.085938 0.246094 +vt 0.000000 0.246094 +vt 0.000000 0.574219 +vt 0.164063 0.218750 +vt 0.113281 0.136719 +vt 0.226563 0.136719 +vt 0.707031 0.246094 +vt 0.707031 0.156250 +vt 0.640625 0.156250 +vt 0.292969 0.218750 +vt 0.496094 0.156250 +vt 0.496094 0.246094 +vt 0.414063 0.246094 +vt 0.414062 0.156250 +vt 0.324219 0.156250 +vt 1.000000 0.246094 +vt 0.933594 0.316406 +vt 0.574219 0.156250 +vt 0.574219 0.246094 +s 0 +usemtl m0 +f 6/1/1 3/2/1 14/3/1 +f 2/4/2 4/5/2 5/6/2 1/7/2 +f 12/8/3 9/9/3 8/10/3 +f 1/11/4 5/12/4 12/8/4 +f 10/13/5 9/14/5 12/15/5 +f 12/15/6 6/1/6 14/3/6 +f 8/16/7 2/4/7 1/7/7 +f 10/13/8 13/17/8 9/14/8 +f 11/18/9 13/17/9 10/13/9 +f 7/19/10 13/17/10 11/18/10 +f 8/10/11 9/9/11 13/20/11 +f 2/21/12 13/20/12 4/22/12 +f 7/19/13 23/17/13 13/23/13 +f 12/15/14 14/3/14 10/13/14 +f 3/2/15 11/18/15 10/13/15 +f 6/1/16 24/3/16 17/2/16 +f 16/4/17 15/7/17 5/6/17 4/5/17 +f 18/24/18 19/25/18 22/26/18 +f 15/27/19 22/26/19 5/28/19 +f 12/8/20 22/29/20 6/30/20 +f 20/13/21 22/15/21 19/14/21 +f 22/15/22 24/3/22 6/1/22 +f 18/16/23 15/7/23 16/4/23 +f 20/13/24 19/14/24 23/17/24 +f 21/18/25 20/13/25 23/17/25 +f 7/19/26 21/18/26 23/17/26 +f 18/24/27 16/31/27 23/32/27 +f 16/31/28 4/22/28 23/32/28 +f 22/15/29 20/13/29 24/3/29 +f 17/2/30 24/3/30 20/13/30 +f 5/12/31 22/29/31 12/8/31 +f 23/32/32 4/22/32 13/20/32 +f 1/11/33 12/8/33 8/10/33 +f 15/27/34 18/24/34 22/26/34 +f 2/21/35 8/10/35 13/20/35 +f 19/25/36 18/24/36 23/32/36 +f 14/3/37 3/2/37 10/13/37 +f 21/18/38 17/2/38 20/13/38 +f 7/19/39 11/18/39 3/2/39 +f 17/2/40 21/18/40 7/19/40 +f 7/19/41 3/2/41 17/2/41 +f 3/2/42 6/1/42 17/2/42 diff --git a/obj/04_RIGHT_SHOULDER.obj b/obj/04_RIGHT_SHOULDER.obj new file mode 100644 index 0000000..4c5a663 --- /dev/null +++ b/obj/04_RIGHT_SHOULDER.obj @@ -0,0 +1,95 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 04_RIGHT_SHOULDER +v -0.001304 -0.110761 0.053996 +v -0.004563 0.010460 0.052408 +v -0.005302 0.025530 -0.043765 +v 0.029417 -0.110761 -0.000726 +v -0.045452 -0.110761 0.012528 +v -0.006074 -0.110761 -0.051184 +v -0.042797 0.010460 0.034398 +v 0.043732 0.010112 -0.015334 +v -0.043254 0.025530 -0.025040 +v 0.003961 0.041274 0.004420 +v -0.000811 -0.110761 0.083059 +v -0.067707 -0.110761 0.013876 +v -0.012124 -0.110761 -0.077836 +v 0.067561 -0.110761 -0.002733 +v 0.080654 -0.228609 0.000871 +v -0.003241 -0.228609 0.089367 +v -0.076647 -0.228609 0.015346 +v -0.013503 -0.228609 -0.088487 +vn 0.5114 0.0438 -0.8582 +vn 0.8716 0.0298 0.4893 +vn 0.8139 -0.0262 0.5804 +vn 0.8068 -0.1641 -0.5675 +vn -0.4419 0.0513 -0.8956 +vn -0.9997 0.0196 0.0127 +vn -0.4261 0.0004 0.9047 +vn -0.6800 -0.1157 0.7240 +vn -0.4316 0.8736 0.2248 +vn 0.6763 0.5593 0.4793 +vn -0.2335 0.8365 0.4957 +vn 0.4613 0.8134 -0.3544 +vn -0.1397 0.9488 -0.2832 +vn 0.7517 0.0616 0.6567 +vn -0.8534 0.0575 -0.5181 +vn 0.6849 0.0539 -0.7267 +vn -0.7131 0.0575 0.6987 +vn -0.0000 1.0000 -0.0000 +vn -0.8434 -0.1301 -0.5213 +vn 0.6872 0.0574 -0.7242 +vt 0.738281 0.640625 +vt 0.738281 0.707031 +vt 0.769531 0.707031 +vt 0.824219 0.707031 +vt 0.824219 0.640625 +vt 0.785156 0.640625 +vt 1.000000 0.707031 +vt 1.000000 0.640625 +vt 0.968750 0.707031 +vt 0.953125 0.640625 +vt 0.941406 0.707031 +vt 0.914063 0.640625 +vt 0.914063 0.707031 +vt 0.957031 0.738281 +vt 0.953125 0.753906 +vt 0.933594 0.738281 +vt 0.976563 0.738281 +vt 0.828125 0.554688 +vt 0.828125 0.628906 +vt 0.914063 0.628906 +vt 0.904761 0.554688 +vt 0.656250 0.554687 +vt 0.656250 0.628906 +vt 0.742188 0.628906 +vt 0.755364 0.554688 +vt 1.000000 0.628906 +vt 1.000000 0.554688 +vt 0.420605 0.471587 +vt 0.404667 0.473659 +vt 0.404667 0.455337 +vt 0.422892 0.453822 +s 0 +usemtl m0 +f 6/1/1 3/2/1 8/3/1 +f 2/4/2 1/5/2 4/6/2 +f 2/4/3 4/6/3 8/3/3 +f 8/3/4 4/6/4 6/1/4 +f 3/7/5 6/8/5 9/9/5 +f 5/10/6 7/11/6 9/9/6 +f 7/11/7 1/12/7 2/13/7 +f 1/12/8 7/11/8 5/10/8 +f 7/11/9 10/14/9 9/9/9 +f 8/15/10 10/14/10 2/16/10 +f 2/16/11 10/14/11 7/11/11 +f 3/17/12 10/14/12 8/15/12 +f 9/9/13 10/14/13 3/17/13 +f 15/18/14 14/19/14 11/20/14 16/21/14 +f 17/22/15 12/23/15 13/24/15 18/25/15 +f 15/18/16 13/24/16 14/19/16 +f 16/21/17 11/20/17 12/26/17 17/27/17 +f 12/28/18 11/29/18 14/30/18 13/31/18 +f 9/9/19 6/8/19 5/10/19 +f 18/25/20 13/24/20 15/18/20 diff --git a/obj/05_RIGHT_ARM.obj b/obj/05_RIGHT_ARM.obj new file mode 100644 index 0000000..979eb05 --- /dev/null +++ b/obj/05_RIGHT_ARM.obj @@ -0,0 +1,49 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 05_RIGHT_ARM +v 0.050654 0.001391 0.000871 +v -0.033241 0.001391 0.089367 +v -0.106647 0.001391 0.015346 +v -0.043503 0.001391 -0.088487 +v 0.021413 -0.210620 0.122202 +v -0.119822 -0.210620 -0.066919 +v -0.116910 -0.210620 0.079673 +v 0.033565 -0.210620 -0.114988 +v 0.107256 -0.210620 0.001896 +vn -0.9983 0.0543 0.0198 +vn 0.7797 0.2872 0.5564 +vn 0.6516 0.3227 -0.6865 +vn -0.2990 0.0106 -0.9542 +vn -0.2931 0.0721 0.9534 +vn -0.6892 0.2407 0.6834 +vn -0.8280 0.2468 -0.5035 +vn 0.8256 0.2179 -0.5205 +vn 0.7120 0.1934 0.6750 +vn -0.0000 1.0000 -0.0000 +vt 0.574219 0.429688 +vt 0.656250 0.554687 +vt 0.656250 0.429688 +vt 0.914063 0.429688 +vt 0.828125 0.429688 +vt 0.904761 0.554688 +vt 0.755364 0.554688 +vt 0.828125 0.554688 +vt 0.746094 0.429688 +vt 1.000000 0.429688 +vt 1.000000 0.554688 +vt 0.755364 0.558757 +vt 0.656250 0.558757 +vt 0.828125 0.558757 +s 0 +usemtl m0 +f 7/1/1 3/2/1 6/3/1 +f 5/4/2 9/5/2 2/6/2 +f 4/7/3 1/8/3 8/9/3 +f 6/3/4 4/7/4 8/9/4 +f 5/4/5 2/6/5 7/10/5 +f 2/6/6 3/11/6 7/10/6 +f 3/2/7 4/7/7 6/3/7 +f 8/9/8 1/8/8 9/5/8 +f 2/6/9 9/5/9 1/8/9 +f 4/12/10 3/13/10 1/14/10 diff --git a/obj/06_RIGHT_HAND.obj b/obj/06_RIGHT_HAND.obj new file mode 100644 index 0000000..44589b1 --- /dev/null +++ b/obj/06_RIGHT_HAND.obj @@ -0,0 +1,80 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 06_RIGHT_HAND +v -0.117266 -0.162877 0.112860 +v 0.161794 -0.162877 0.001429 +v -0.121219 -0.162877 -0.092793 +v 0.042547 -0.162877 -0.136543 +v 0.048109 -0.162877 0.162731 +v -0.023099 -0.220058 0.060309 +v -0.025254 -0.220058 -0.048186 +v 0.074679 -0.162877 -0.070127 +v 0.077624 -0.162877 0.078151 +v -0.079601 -0.162877 0.092047 +v -0.083018 -0.162877 -0.079924 +v -0.116910 -0.030620 0.079673 +v 0.021413 -0.030620 0.122202 +v -0.119822 -0.030620 -0.066919 +v 0.033565 -0.030620 -0.114987 +v 0.107256 -0.030620 0.001896 +vn 0.4950 -0.8688 -0.0098 +vn -0.7073 -0.7067 0.0141 +vn 0.0798 -0.4223 0.9029 +vn 0.0556 -0.4410 -0.8958 +vn -0.2832 0.2312 0.9308 +vn -0.2744 0.1621 -0.9479 +vn 0.7982 0.3309 -0.5033 +vn 0.7702 0.3238 0.5495 +vn -0.9998 0.0072 0.0195 +vn -0.0000 -1.0000 -0.0000 +vn 0.7473 0.1560 -0.6459 +vn 0.7750 0.3177 0.5463 +vn -0.0000 1.0000 -0.0000 +vt 0.531250 0.054688 +vt 0.507812 0.156250 +vt 0.660156 0.156250 +vt 0.632812 0.054688 +vt 0.660156 -0.000000 +vt 0.507812 -0.000000 +vt 0.933594 0.320312 +vt 0.914063 0.429688 +vt 1.000000 0.429688 +vt 1.000000 0.320312 +vt 0.656250 0.320312 +vt 0.656250 0.429688 +vt 0.746094 0.429688 +vt 0.742188 0.320312 +vt 0.828125 0.320312 +vt 0.828125 0.429688 +vt 0.574219 0.320312 +vt 0.574219 0.429688 +vt 0.367662 0.001560 +vt 0.344248 0.089203 +vt 0.504411 0.092180 +vt 0.477721 0.003676 +vt 0.418087 0.153021 +vt 0.741643 0.265474 +vt 0.749336 0.267730 +vt 0.749304 0.255955 +vt 0.741620 0.258199 +vt 0.828125 0.482106 +vt 0.746094 0.474667 +vt 0.914063 0.473440 +s 0 +usemtl m0 +f 7/1/1 8/2/1 9/3/1 6/4/1 +f 6/4/2 10/5/2 11/6/2 7/1/2 +f 6/4/3 9/3/3 10/5/3 +f 7/1/4 11/6/4 8/2/4 +f 5/7/5 13/8/5 12/9/5 1/10/5 +f 3/11/6 14/12/6 15/13/6 4/14/6 +f 2/15/7 15/13/7 16/16/7 +f 13/8/8 5/7/8 16/16/8 +f 1/17/9 12/18/9 14/12/9 3/11/9 +f 3/19/10 4/20/10 5/21/10 1/22/10 +f 2/23/10 5/21/10 4/20/10 +f 4/14/11 15/13/11 2/15/11 +f 16/16/12 5/7/12 2/15/12 +f 12/24/13 13/25/13 15/26/13 14/27/13 +f 16/28/13 15/29/13 13/30/13 diff --git a/obj/07_LEFT_SHOULDER.obj b/obj/07_LEFT_SHOULDER.obj new file mode 100644 index 0000000..2a5155e --- /dev/null +++ b/obj/07_LEFT_SHOULDER.obj @@ -0,0 +1,93 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 07_LEFT_SHOULDER +v -0.029399 -0.110790 -0.000726 +v 0.006092 -0.110790 -0.051183 +v 0.004581 0.010431 0.052408 +v 0.005320 0.025501 -0.043765 +v 0.001322 -0.110790 0.053997 +v 0.045470 -0.110790 0.012528 +v 0.042815 0.010431 0.034399 +v -0.043714 0.010083 -0.015334 +v 0.043271 0.025501 -0.025040 +v -0.003943 0.041245 0.004420 +v 0.000829 -0.110790 0.083059 +v 0.067725 -0.110790 0.013877 +v 0.012141 -0.110790 -0.077836 +v -0.067543 -0.110790 -0.002733 +v -0.080636 -0.228638 0.000871 +v 0.003258 -0.228638 0.089368 +v 0.076665 -0.228638 0.015347 +v 0.013521 -0.228638 -0.088487 +vn -0.5114 0.0438 -0.8582 +vn -0.8716 0.0298 0.4893 +vn -0.8139 -0.0262 0.5804 +vn -0.8068 -0.1641 -0.5675 +vn 0.4419 0.0513 -0.8956 +vn 0.9997 0.0196 0.0127 +vn 0.4261 0.0004 0.9047 +vn 0.6800 -0.1157 0.7240 +vn 0.4316 0.8736 0.2248 +vn -0.6763 0.5593 0.4793 +vn 0.2335 0.8365 0.4957 +vn -0.4613 0.8134 -0.3544 +vn 0.1397 0.9488 -0.2832 +vn -0.7517 0.0616 0.6567 +vn 0.8534 0.0575 -0.5181 +vn -0.6849 0.0539 -0.7267 +vn 0.7131 0.0575 0.6987 +vn -0.0000 1.0000 -0.0000 +vn 0.8434 -0.1301 -0.5213 +vn -0.6872 0.0574 -0.7242 +vt 0.824219 0.640625 +vt 0.855469 0.707031 +vt 0.824219 0.707031 +vt 0.914063 0.707031 +vt 0.871094 0.640625 +vt 0.914063 0.640625 +vt 1.000000 0.707031 +vt 0.968750 0.707031 +vt 1.000000 0.640625 +vt 0.953125 0.640625 +vt 0.941406 0.707031 +vt 0.957031 0.738281 +vt 0.953125 0.753906 +vt 0.933594 0.738281 +vt 0.976563 0.738281 +vt 0.828125 0.554688 +vt 0.904761 0.554688 +vt 0.914063 0.628906 +vt 0.828125 0.628906 +vt 0.656250 0.554687 +vt 0.755364 0.554688 +vt 0.742188 0.628906 +vt 0.656250 0.628906 +vt 1.000000 0.554688 +vt 1.000000 0.628906 +vt 0.388720 0.471587 +vt 0.386434 0.453822 +vt 0.404659 0.455337 +vt 0.404659 0.473659 +s 0 +usemtl m0 +f 2/1/1 8/2/1 4/3/1 +f 3/4/2 1/5/2 5/6/2 +f 3/4/3 8/2/3 1/5/3 +f 8/2/4 2/1/4 1/5/4 +f 4/7/5 9/8/5 2/9/5 +f 6/10/6 9/8/6 7/11/6 +f 7/11/7 3/4/7 5/6/7 +f 5/6/8 6/10/8 7/11/8 +f 7/11/9 9/8/9 10/12/9 +f 8/13/10 3/14/10 10/12/10 +f 3/14/11 7/11/11 10/12/11 +f 4/15/12 8/13/12 10/12/12 +f 9/8/13 4/15/13 10/12/13 +f 15/16/14 16/17/14 11/18/14 14/19/14 +f 17/20/15 18/21/15 13/22/15 12/23/15 +f 15/16/16 14/19/16 13/22/16 +f 16/17/17 17/24/17 12/25/17 11/18/17 +f 12/26/18 13/27/18 14/28/18 11/29/18 +f 9/8/19 6/10/19 2/9/19 +f 18/21/20 15/16/20 13/22/20 diff --git a/obj/08_LEFT_ARM.obj b/obj/08_LEFT_ARM.obj new file mode 100644 index 0000000..7548222 --- /dev/null +++ b/obj/08_LEFT_ARM.obj @@ -0,0 +1,49 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 08_LEFT_ARM +v -0.050636 0.001362 0.000871 +v 0.033258 0.001362 0.089368 +v 0.106665 0.001362 0.015347 +v 0.043521 0.001362 -0.088487 +v -0.021395 -0.210649 0.122203 +v 0.119839 -0.210649 -0.066919 +v 0.116928 -0.210649 0.079673 +v -0.033547 -0.210649 -0.114987 +v -0.107238 -0.210649 0.001896 +vn 0.9983 0.0543 0.0198 +vn -0.7797 0.2872 0.5564 +vn -0.6516 0.3227 -0.6865 +vn 0.2990 0.0106 -0.9542 +vn 0.2931 0.0721 0.9534 +vn 0.6892 0.2407 0.6834 +vn 0.8280 0.2468 -0.5035 +vn -0.8256 0.2179 -0.5205 +vn -0.7120 0.1934 0.6750 +vn -0.0000 1.0000 -0.0000 +vt 0.574219 0.429688 +vt 0.656250 0.429688 +vt 0.656250 0.554687 +vt 0.914063 0.429688 +vt 0.904761 0.554688 +vt 0.828125 0.429688 +vt 0.755364 0.554688 +vt 0.746094 0.429688 +vt 0.828125 0.554688 +vt 1.000000 0.429688 +vt 1.000000 0.554688 +vt 0.755364 0.558757 +vt 0.828125 0.558757 +vt 0.656250 0.558757 +s 0 +usemtl m0 +f 7/1/1 6/2/1 3/3/1 +f 5/4/2 2/5/2 9/6/2 +f 4/7/3 8/8/3 1/9/3 +f 6/2/4 8/8/4 4/7/4 +f 5/4/5 7/10/5 2/5/5 +f 2/5/6 7/10/6 3/11/6 +f 3/3/7 6/2/7 4/7/7 +f 8/8/8 9/6/8 1/9/8 +f 2/5/9 1/9/9 9/6/9 +f 4/12/10 1/13/10 3/14/10 diff --git a/obj/09_LEFT_HAND.obj b/obj/09_LEFT_HAND.obj new file mode 100644 index 0000000..cc26c4e --- /dev/null +++ b/obj/09_LEFT_HAND.obj @@ -0,0 +1,80 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 09_LEFT_HAND +v 0.117284 -0.162906 0.112860 +v -0.161777 -0.162906 0.001429 +v 0.121237 -0.162906 -0.092793 +v -0.042529 -0.162906 -0.136543 +v -0.048091 -0.162906 0.162731 +v 0.023117 -0.220087 0.060309 +v 0.025272 -0.220087 -0.048186 +v -0.074661 -0.162906 -0.070127 +v -0.077607 -0.162906 0.078151 +v 0.079619 -0.162906 0.092047 +v 0.083035 -0.162906 -0.079923 +v -0.021395 -0.030649 0.122203 +v 0.119840 -0.030648 -0.066919 +v 0.116928 -0.030649 0.079673 +v -0.033547 -0.030648 -0.114987 +v -0.107238 -0.030648 0.001896 +vn -0.4950 -0.8688 -0.0098 +vn 0.7073 -0.7067 0.0141 +vn -0.0798 -0.4223 0.9029 +vn -0.0556 -0.4410 -0.8958 +vn 0.2832 0.2312 0.9308 +vn 0.2744 0.1621 -0.9479 +vn -0.7982 0.3309 -0.5033 +vn -0.7702 0.3238 0.5495 +vn 0.9998 0.0072 0.0195 +vn -0.0000 -1.0000 -0.0000 +vn -0.7473 0.1560 -0.6459 +vn -0.7750 0.3177 0.5463 +vn -0.0000 1.0000 -0.0000 +vt 0.531250 0.054688 +vt 0.632812 0.054688 +vt 0.660156 0.156250 +vt 0.507812 0.156250 +vt 0.507812 -0.000000 +vt 0.660156 -0.000000 +vt 0.933594 0.320312 +vt 1.000000 0.320312 +vt 1.000000 0.429688 +vt 0.914063 0.429688 +vt 0.656250 0.320312 +vt 0.742188 0.320312 +vt 0.746094 0.429688 +vt 0.656250 0.429688 +vt 0.828125 0.320312 +vt 0.828125 0.429688 +vt 0.574219 0.320312 +vt 0.574219 0.429688 +vt 0.367662 0.001560 +vt 0.477721 0.003676 +vt 0.504411 0.092180 +vt 0.344248 0.089203 +vt 0.418087 0.153021 +vt 0.741643 0.265474 +vt 0.741620 0.258199 +vt 0.749304 0.255955 +vt 0.749336 0.267730 +vt 0.828125 0.482106 +vt 0.914063 0.473440 +vt 0.746094 0.474667 +s 0 +usemtl m0 +f 7/1/1 6/2/1 9/3/1 8/4/1 +f 6/2/2 7/1/2 11/5/2 10/6/2 +f 6/2/3 10/6/3 9/3/3 +f 7/1/4 8/4/4 11/5/4 +f 5/7/5 1/8/5 14/9/5 12/10/5 +f 3/11/6 4/12/6 15/13/6 13/14/6 +f 2/15/7 16/16/7 15/13/7 +f 12/10/8 16/16/8 5/7/8 +f 1/17/9 3/11/9 13/14/9 14/18/9 +f 3/19/10 1/20/10 5/21/10 4/22/10 +f 2/23/10 4/22/10 5/21/10 +f 4/12/11 2/15/11 15/13/11 +f 16/16/12 2/15/12 5/7/12 +f 14/24/13 13/25/13 15/26/13 12/27/13 +f 16/28/13 12/29/13 15/30/13 diff --git a/obj/10_LEG_RIGHT_TOP.obj b/obj/10_LEG_RIGHT_TOP.obj new file mode 100644 index 0000000..30c84d5 --- /dev/null +++ b/obj/10_LEG_RIGHT_TOP.obj @@ -0,0 +1,50 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 10_LEG_RIGHT_TOP +v -0.044095 0.020948 0.086824 +v 0.020548 -0.007424 -0.067808 +v 0.062566 -0.024376 0.088570 +v -0.005802 -0.330741 0.064891 +v 0.017236 -0.313477 -0.049809 +v 0.048247 -0.325533 0.063145 +v -0.071257 0.040366 -0.004026 +v 0.087176 -0.034027 -0.018997 +v 0.072347 -0.313477 -0.009491 +v -0.033647 -0.319409 0.003816 +vn -0.9592 -0.0945 0.2666 +vn 0.5759 -0.0542 -0.8157 +vn -0.0182 -0.0730 0.9972 +vn 0.9641 -0.0555 0.2598 +vn -0.5845 -0.0413 -0.8103 +vn -0.9114 -0.1237 0.3925 +vn -0.7175 -0.0901 -0.6907 +vn 0.5894 -0.0587 -0.8057 +vn 0.0521 -0.9835 -0.1735 +vt 0.558594 0.859375 +vt 0.558594 0.808594 +vt 0.765625 0.808594 +vt 0.765625 1.000000 +vt 0.578125 1.000000 +vt 0.601562 0.949219 +vt 0.765625 0.902344 +vt 0.585938 0.902344 +vt 0.765625 0.859375 +vt 0.765625 0.949219 +vt 0.578125 0.757812 +vt 0.765625 0.757812 +vt 0.761011 0.859375 +vt 0.761011 0.808594 +vt 0.761011 0.949219 +vt 0.761011 0.902344 +s 0 +usemtl m0 +f 1/1/1 7/2/1 10/3/1 +f 5/4/2 2/5/2 8/6/2 +f 6/7/3 3/8/3 1/1/3 4/9/3 +f 9/10/4 8/6/4 3/8/4 6/7/4 +f 7/2/5 2/11/5 5/12/5 +f 4/9/6 1/1/6 10/3/6 +f 10/3/7 7/2/7 5/12/7 +f 9/10/8 5/4/8 8/6/8 +f 4/13/9 10/14/9 9/15/9 6/16/9 diff --git a/obj/11_LEG_RIGHT_BOTTOM.obj b/obj/11_LEG_RIGHT_BOTTOM.obj new file mode 100644 index 0000000..5818eb0 --- /dev/null +++ b/obj/11_LEG_RIGHT_BOTTOM.obj @@ -0,0 +1,55 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 11_LEG_RIGHT_BOTTOM +v -0.014770 -0.391438 0.026427 +v 0.037815 -0.391438 0.019039 +v 0.014508 -0.401962 -0.054218 +v -0.005802 -0.030741 0.064891 +v 0.017236 -0.013477 -0.049809 +v 0.048247 -0.025533 0.063145 +v -0.032242 -0.401962 -0.021617 +v 0.058397 -0.401962 -0.019445 +v 0.072347 -0.013477 -0.009491 +v -0.033647 -0.019408 0.003816 +v 0.011276 -0.115637 -0.083052 +v -0.053378 -0.141678 -0.007322 +vn -0.7544 0.2094 -0.6221 +vn -0.8972 0.1057 0.4287 +vn 0.5756 0.2225 -0.7869 +vn 0.7322 -0.0307 -0.6804 +vn -0.8509 -0.0610 0.5219 +vn -0.6902 -0.0500 -0.7218 +vn 0.9266 -0.0566 0.3718 +vn 0.0903 -0.1148 0.9893 +vn -0.0521 0.9835 0.1735 +vt 0.839844 0.808594 +vt 0.765625 0.808594 +vt 0.765625 0.757812 +vt 0.824219 0.757812 +vt 0.765625 0.859375 +vt 0.824219 1.000000 +vt 0.765625 1.000000 +vt 0.765625 0.949219 +vt 1.000000 1.000000 +vt 1.000000 0.949219 +vt 1.000000 0.859375 +vt 1.000000 0.808594 +vt 1.000000 0.757812 +vt 0.765625 0.902344 +vt 1.000000 0.902344 +vt 0.761626 0.859375 +vt 0.761626 0.902344 +vt 0.761626 0.949219 +vt 0.761626 0.808594 +s 0 +usemtl m0 +f 12/1/1 10/2/1 5/3/1 11/4/1 +f 4/5/2 10/2/2 12/1/2 +f 11/6/3 5/7/3 9/8/3 +f 3/9/4 11/6/4 9/8/4 8/10/4 +f 1/11/5 4/5/5 12/1/5 7/12/5 +f 7/12/6 12/1/6 11/4/6 3/13/6 +f 8/10/7 9/8/7 6/14/7 2/15/7 +f 2/15/8 6/14/8 4/5/8 1/11/8 +f 4/16/9 6/17/9 9/18/9 10/19/9 diff --git a/obj/12_RIGHT_FOOT.obj b/obj/12_RIGHT_FOOT.obj new file mode 100644 index 0000000..d599841 --- /dev/null +++ b/obj/12_RIGHT_FOOT.obj @@ -0,0 +1,89 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 12_RIGHT_FOOT +v -0.014770 0.008562 0.026427 +v 0.037815 0.008562 0.019039 +v 0.014508 -0.001962 -0.054218 +v -0.032242 -0.001962 -0.021617 +v 0.058397 -0.001962 -0.019445 +v -0.034525 -0.070034 0.110817 +v 0.052145 -0.086498 0.112887 +v 0.035393 -0.118275 0.230740 +v 0.035393 -0.197925 0.233416 +v 0.069746 -0.197925 -0.078636 +v -0.038881 -0.197925 0.207450 +v 0.080132 -0.197925 0.206795 +v -0.046571 -0.197925 -0.043631 +v 0.047175 -0.197925 0.072835 +v -0.041683 -0.116878 0.222416 +vn 0.1105 0.7102 0.6953 +vn 0.1728 0.9446 0.2792 +vn -0.0249 0.9223 0.3856 +vn 0.8756 0.4204 0.2378 +vn -0.9987 -0.0402 0.0306 +vn 0.9702 0.0425 -0.2387 +vn -0.5669 0.1328 -0.8130 +vn -0.1067 0.0334 0.9937 +vn 0.5111 0.0289 0.8590 +vn 0.5991 0.2631 -0.7562 +vn 0.9969 0.0365 0.0704 +vn 0.8343 0.4459 0.3243 +vn -0.8663 0.4502 0.2165 +vn -0.9973 0.0708 0.0192 +vn -0.9934 0.1132 -0.0162 +vn -0.2880 0.0381 -0.9569 +vn -0.3245 -0.1826 0.9281 +vn 0.9844 -0.0966 0.1467 +vn -0.0000 -1.0000 -0.0000 +vt 0.878906 0.156250 +vt 0.835938 0.156250 +vt 0.835938 0.093750 +vt 0.878906 0.093750 +vt 0.878906 0.035156 +vt 0.835938 0.035156 +vt 0.878906 0.000000 +vt 0.933594 0.058594 +vt 0.718750 0.000000 +vt 0.835938 0.000000 +vt 0.933594 0.000000 +vt 0.726562 0.097656 +vt 0.699219 0.097656 +vt 0.859375 0.000000 +vt 0.667969 0.000000 +vt 0.667969 0.097656 +vt 1.000000 0.000000 +vt 1.000000 0.097656 +vt 0.964844 0.097656 +vt 0.750000 0.097656 +vt 0.789062 0.062500 +vt 0.648438 0.617187 +vt 0.593750 0.613281 +vt 0.613281 0.601562 +vt 0.648438 0.737451 +vt 0.602700 0.679687 +vt 0.590982 0.753076 +s 0 +usemtl m0 +f 2/1/1 1/2/1 6/3/1 7/4/1 +f 7/4/2 6/3/2 8/5/2 +f 8/5/3 6/3/3 15/6/3 +f 12/7/4 7/8/4 8/5/4 +f 13/9/5 11/10/5 15/6/5 +f 14/11/6 7/8/6 12/7/6 +f 13/9/7 4/12/7 3/13/7 +f 8/5/8 15/6/8 9/14/8 +f 9/14/9 12/7/9 8/5/9 +f 10/15/10 3/13/10 5/16/10 +f 10/17/11 5/18/11 7/8/11 +f 2/19/12 7/8/12 5/18/12 +f 1/20/13 4/12/13 6/21/13 +f 13/9/14 6/21/14 4/12/14 +f 6/21/15 13/9/15 15/6/15 +f 10/15/16 13/9/16 3/13/16 +f 15/6/17 11/10/17 9/14/17 +f 14/11/18 10/17/18 7/8/18 +f 11/22/19 12/23/19 9/24/19 +f 11/22/19 13/25/19 14/26/19 +f 13/25/19 10/27/19 14/26/19 +f 12/23/19 11/22/19 14/26/19 diff --git a/obj/13_LEG_LEFT_TOP.obj b/obj/13_LEG_LEFT_TOP.obj new file mode 100644 index 0000000..548474e --- /dev/null +++ b/obj/13_LEG_LEFT_TOP.obj @@ -0,0 +1,50 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 13_LEG_LEFT_TOP +v 0.044095 0.020948 0.086824 +v -0.020548 -0.007424 -0.067808 +v -0.062566 -0.024376 0.088570 +v 0.005802 -0.330741 0.064891 +v -0.017236 -0.313477 -0.049809 +v -0.048247 -0.325533 0.063145 +v 0.071257 0.040366 -0.004026 +v -0.087176 -0.034027 -0.018997 +v -0.072347 -0.313477 -0.009491 +v 0.033647 -0.319409 0.003816 +vn 0.9592 -0.0945 0.2666 +vn -0.5759 -0.0542 -0.8157 +vn 0.0182 -0.0730 0.9972 +vn -0.9641 -0.0555 0.2598 +vn 0.5845 -0.0413 -0.8103 +vn 0.9114 -0.1237 0.3925 +vn 0.7175 -0.0901 -0.6907 +vn -0.5894 -0.0587 -0.8057 +vn -0.0521 -0.9835 -0.1735 +vt 0.558594 0.859375 +vt 0.765625 0.808594 +vt 0.558594 0.808594 +vt 0.765625 1.000000 +vt 0.601562 0.949219 +vt 0.578125 1.000000 +vt 0.765625 0.902344 +vt 0.765625 0.859375 +vt 0.585938 0.902344 +vt 0.765625 0.949219 +vt 0.765625 0.757812 +vt 0.578125 0.757812 +vt 0.761011 0.859375 +vt 0.761011 0.902344 +vt 0.761011 0.949219 +vt 0.761011 0.808594 +s 0 +usemtl m0 +f 1/1/1 10/2/1 7/3/1 +f 5/4/2 8/5/2 2/6/2 +f 6/7/3 4/8/3 1/1/3 3/9/3 +f 9/10/4 6/7/4 3/9/4 8/5/4 +f 7/3/5 5/11/5 2/12/5 +f 4/8/6 10/2/6 1/1/6 +f 10/2/7 5/11/7 7/3/7 +f 9/10/8 8/5/8 5/4/8 +f 4/13/9 6/14/9 9/15/9 10/16/9 diff --git a/obj/14_LEG_LEFT_BOTTOM.obj b/obj/14_LEG_LEFT_BOTTOM.obj new file mode 100644 index 0000000..eb8a770 --- /dev/null +++ b/obj/14_LEG_LEFT_BOTTOM.obj @@ -0,0 +1,56 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 14_LEG_LEFT_BOTTOM +v 0.014770 -0.391438 0.026427 +v -0.037815 -0.391438 0.019039 +v -0.014508 -0.401962 -0.054218 +v 0.005802 -0.030741 0.064891 +v -0.017236 -0.013477 -0.049809 +v -0.048247 -0.025533 0.063145 +v 0.032242 -0.401962 -0.021617 +v -0.058397 -0.401962 -0.019445 +v -0.072347 -0.013477 -0.009491 +v 0.033647 -0.019408 0.003816 +v -0.011276 -0.115637 -0.083052 +v 0.053378 -0.141678 -0.007322 +vn 0.7544 0.2094 -0.6221 +vn 0.8972 0.1057 0.4287 +vn -0.5756 0.2225 -0.7869 +vn -0.7322 -0.0307 -0.6804 +vn 0.8509 -0.0610 0.5219 +vn 0.6902 -0.0500 -0.7218 +vn -0.9266 -0.0566 0.3718 +vn -0.0903 -0.1148 0.9893 +vn 0.0521 0.9835 0.1735 +vt 0.839844 0.808594 +vt 0.824219 0.757812 +vt 0.765625 0.757812 +vt 0.765625 0.808594 +vt 0.765625 0.859375 +vt 0.824219 1.000000 +vt 0.765625 0.949219 +vt 0.765625 1.000000 +vt 1.000000 1.000000 +vt 1.000000 0.949219 +vt 0.765625 0.949219 +vt 1.000000 0.859375 +vt 1.000000 0.808594 +vt 1.000000 0.757812 +vt 1.000000 0.902344 +vt 0.765625 0.902344 +vt 0.761626 0.859375 +vt 0.761626 0.808594 +vt 0.761626 0.949219 +vt 0.761626 0.902344 +s 0 +usemtl m0 +f 12/1/1 11/2/1 5/3/1 10/4/1 +f 4/5/2 12/1/2 10/4/2 +f 11/6/3 9/7/3 5/8/3 +f 3/9/4 8/10/4 9/11/4 11/6/4 +f 1/12/5 7/13/5 12/1/5 4/5/5 +f 7/13/6 3/14/6 11/2/6 12/1/6 +f 8/10/7 2/15/7 6/16/7 9/11/7 +f 2/15/8 1/12/8 4/5/8 6/16/8 +f 4/17/9 10/18/9 9/19/9 6/20/9 diff --git a/obj/15_LEFT_FOOT.obj b/obj/15_LEFT_FOOT.obj new file mode 100644 index 0000000..e603829 --- /dev/null +++ b/obj/15_LEFT_FOOT.obj @@ -0,0 +1,89 @@ +# Blender 4.0.2 +# www.blender.org +mtllib miku.mtl +o 15_LEFT_FOOT +v 0.014770 0.008562 0.026427 +v -0.037815 0.008562 0.019039 +v -0.014508 -0.001962 -0.054218 +v 0.032242 -0.001962 -0.021617 +v -0.058397 -0.001962 -0.019445 +v 0.034525 -0.070034 0.110817 +v -0.052145 -0.086498 0.112887 +v -0.035393 -0.118275 0.230740 +v -0.035393 -0.197925 0.233416 +v -0.069746 -0.197925 -0.078636 +v 0.038881 -0.197925 0.207450 +v -0.080132 -0.197925 0.206795 +v 0.046571 -0.197925 -0.043631 +v -0.047175 -0.197925 0.072835 +v 0.041683 -0.116878 0.222416 +vn -0.1105 0.7102 0.6953 +vn -0.1728 0.9446 0.2792 +vn 0.0249 0.9223 0.3856 +vn -0.8756 0.4204 0.2378 +vn 0.9987 -0.0402 0.0306 +vn -0.9702 0.0425 -0.2387 +vn 0.5669 0.1328 -0.8130 +vn 0.1067 0.0334 0.9937 +vn -0.5111 0.0289 0.8590 +vn -0.5991 0.2631 -0.7562 +vn -0.9969 0.0365 0.0704 +vn -0.8343 0.4459 0.3243 +vn 0.8663 0.4502 0.2165 +vn 0.9973 0.0708 0.0192 +vn 0.9934 0.1132 -0.0162 +vn 0.2880 0.0381 -0.9569 +vn 0.3245 -0.1826 0.9281 +vn -0.9844 -0.0966 0.1467 +vn -0.0000 -1.0000 -0.0000 +vt 0.878906 0.156250 +vt 0.878906 0.093750 +vt 0.835938 0.093750 +vt 0.835938 0.156250 +vt 0.878906 0.035156 +vt 0.835938 0.035156 +vt 0.878906 0.000000 +vt 0.933594 0.058594 +vt 0.718750 0.000000 +vt 0.835938 0.000000 +vt 0.933594 0.000000 +vt 0.699219 0.097656 +vt 0.726562 0.097656 +vt 0.859375 0.000000 +vt 0.667969 0.000000 +vt 0.667969 0.097656 +vt 1.000000 0.000000 +vt 1.000000 0.097656 +vt 0.964844 0.097656 +vt 0.750000 0.097656 +vt 0.789062 0.062500 +vt 0.648438 0.617187 +vt 0.613281 0.601562 +vt 0.593750 0.613281 +vt 0.602700 0.679687 +vt 0.648438 0.737451 +vt 0.590982 0.753076 +s 0 +usemtl m0 +f 2/1/1 7/2/1 6/3/1 1/4/1 +f 7/2/2 8/5/2 6/3/2 +f 8/5/3 15/6/3 6/3/3 +f 12/7/4 8/5/4 7/8/4 +f 13/9/5 15/6/5 11/10/5 +f 14/11/6 12/7/6 7/8/6 +f 13/9/7 3/12/7 4/13/7 +f 8/5/8 9/14/8 15/6/8 +f 9/14/9 8/5/9 12/7/9 +f 10/15/10 5/16/10 3/12/10 +f 10/17/11 7/8/11 5/18/11 +f 2/19/12 5/18/12 7/8/12 +f 1/20/13 6/21/13 4/13/13 +f 13/9/14 4/13/14 6/21/14 +f 6/21/15 15/6/15 13/9/15 +f 10/15/16 3/12/16 13/9/16 +f 15/6/17 9/14/17 11/10/17 +f 14/11/18 7/8/18 10/17/18 +f 11/22/19 9/23/19 12/24/19 +f 11/22/19 12/24/19 14/25/19 +f 13/26/19 14/25/19 10/27/19 +f 13/26/19 11/22/19 14/25/19 diff --git a/src/Encode.ts b/src/Encode.ts new file mode 100644 index 0000000..d38f066 --- /dev/null +++ b/src/Encode.ts @@ -0,0 +1,1131 @@ +import { readFileSync, writeFileSync } from 'fs' +import { PNG } from 'pngjs'; +import { + Vector3, + Matrix4, +} from "three"; + +type Primitive = { + tri: Buffer + quad: Buffer + vertices: Buffer +} + +type RawFace = { + "au": number, + "av": number, + "bu": number, + "bv": number, + "cu": number, + "cv": number, + "du": number, + "dv": number, + "isQuad": boolean, + "dword": number, +} + +const encodeTexel = (r: number, g: number, b: number, a: number) => { + const rClr = Math.floor((r >> 3) & 0xff); + const gClr = Math.floor((g >> 3) & 0xff); + const bClr = Math.floor((b >> 3) & 0xff); + const aClr = a === 0 ? 0 : 0x8000 + const texel = rClr | (gClr << 5) | (bClr << 5) | aClr; + return texel; +} + +// Function expects a png buffer for the image +const encodeImage = (pngSrc: Buffer) => { + + const pngInfo = PNG.sync.read(pngSrc); + const { width, height, data } = pngInfo; + + console.log('Encoding image'); + + if (width !== 256 || height !== 256) { + throw new Error("Encoder expects a 256x256 image"); + } + + console.log(data.length.toString(16)) + + let inOfs = 0; + let outOfs = 0; + const palette: number[] = [0] + const pal = Buffer.alloc(0x20, 0) + const img = Buffer.alloc(0x8000, 0) + + const readPixel = () => { + const a = data.readUInt8(inOfs + 3) === 0 ? 0 : 255; + const r = a === 0 ? 0 : data.readUInt8(inOfs + 0) + const g = a === 0 ? 0 : data.readUInt8(inOfs + 1) + const b = a === 0 ? 0 : data.readUInt8(inOfs + 2) + const texel = encodeTexel(r, g, b, a); + inOfs += 4 + + // Search through the existing palette + const index = palette.indexOf(texel); + + // If doesn't exist, we add it to the palette + if (index === -1) { + const pos = palette.length; + palette.push(texel) + return pos; + } + + return index; + } + + for (let y = 0; y < height; y++) { + for (let x = 0; x < width; x += 2) { + const lowByte = readPixel() + const highByte = readPixel() + const byte = ((highByte << 4) | lowByte) & 0xff + img[outOfs] = byte; + outOfs++; + } + } + + // for(let i = 0; i < palette.length; i++){ + // console.log(palette[i].toString(16)) + // } + + outOfs = 0 + console.log('Palette colors: ') + for (let i = 0; i < 16; i++) { + const texel = palette[i] || 0x0000; + console.log(texel.toString(16)) + pal.writeUInt16LE(texel, outOfs) + outOfs += 2 + } + + return [pal, img] +} + +const replaceTexture = ( + gamefile: Buffer, + bodyBuffer: Buffer, + faceBuffer: Buffer, +) => { + + const modded = Buffer.from(gamefile) + const [bodyPal, bodyImg] = encodeImage(bodyBuffer) + const [facePal, faceImg] = encodeImage(faceBuffer) + + let ofs = 0; + + // Paltte 0 + const bodyPalOfs = 0x30 + ofs = bodyPalOfs + for (let i = 0; i < bodyPal.length; i++) { + modded[bodyPalOfs + i] = bodyPal[i] + } + + // Image 0 + const bodyImgOfs = 0x800 + for (let i = 0; i < 0x8000; i++) { + modded[bodyImgOfs + i] = bodyImg[i]; + } + + // palette 1 + // Black for the second texture + ofs = 0x8830 + for (let pal = 0; pal < 3; pal++) { + for (let i = 0; i < 16; i++) { + modded.writeUInt16LE(0x8000, ofs) + ofs += 2; + } + } + + // Pallete 2 + const facePalOfs = 0x9030 + for (let i = 0; i < facePal.length; i++) { + modded[facePalOfs + i] = facePal[i] + } + + // Image 1 + const faceImgOfs = 0x9800 + for (let i = 0; i < 0x4000; i++) { + modded[faceImgOfs + i] = faceImg[i] + } + + return modded; +} +const encodeVertex = (x: number, y: number, z: number) => { + + try { + const xInt = encodeVertexBits(x) + const yInt = encodeVertexBits(y) + const zInt = encodeVertexBits(z) + // Shift and merge vertex to make a 32 bit value + const vertex = xInt | (yInt << 10) | (zInt << 20) + return vertex + } catch (err) { + console.log("0 Scale invalid: ", x, y, z) + } + + try { + const xInt = encodeVertexBits(Math.floor(x / 2)) + const yInt = encodeVertexBits(Math.floor(y / 2)) + const zInt = encodeVertexBits(Math.floor(z / 2)) + // Shift and merge vertex to make a 32 bit value + const vertex = xInt | (yInt << 10) | (zInt << 20) | (1 << 30) + return vertex + } catch (err) { + console.log("1 Scale invalid: ", x, y, z) + throw err; + } + + +} + +// Encode the Vertices +const encodeVertexBits = (num: number) => { + + if (num < 0) { + const lowBits = 512 + num; + const encodedVert = 0x200 | lowBits; + if (encodedVert > 0x3ff) { + return 0x3ff; + throw new Error("Encoded vertex is too larged (neg)") + } + return encodedVert + } else { + if (num > 0x1ff) { + return 0x1ff; + throw new Error("Encoded vertex is too larged (pos)") + } + return num; + } +} + +const encodeDirect = (verts: number[], tris: RawFace[], quads: RawFace[]): Primitive => { + + const SCALE = 1 / 0.00125; + const ROT_X = new Matrix4(); + ROT_X.makeRotationX(Math.PI); + + // First step is to break the file down into primitives + + + const vertices = Buffer.alloc(verts.length * 4, 0) + let vertOfs = 0; + console.log(verts) + for (let i = 0; i < verts.length; i++) { + // Extract string values for x,y,z + vertices.writeUInt32LE(verts[i]) + vertOfs += 4 + } + + + // Encode the triangles for each of the faces + const FACE_MASK = 0x7f; + const tri = Buffer.alloc(tris.length * 12, 0); + let triOfs = 0; + console.log(tris) + for (let i = 0; i < tris.length; i++) { + const { au, av, bu, bv, cu, cv, dword } = tris[i]; + + tri.writeUInt8(au, triOfs) + triOfs++; + tri.writeUInt8(av, triOfs) + triOfs++; + + tri.writeUInt8(bu, triOfs) + triOfs++; + tri.writeUInt8(bv, triOfs) + triOfs++; + + tri.writeUInt8(cu, triOfs) + triOfs++; + tri.writeUInt8(cv, triOfs) + triOfs++; + + tri.writeUInt8(0, triOfs) + triOfs++; + tri.writeUInt8(0, triOfs) + triOfs++; + + // Encode the face indices to a dword + tri.writeUInt32LE(dword, triOfs) + triOfs += 4 + } + + console.log(tri); + + const quad = Buffer.alloc(quads.length * 12, 0); + let quadOfs = 0; + for (let i = 0; i < quads.length; i++) { + const { au, av, bu, bv, cu, cv, du, dv, dword } = quads[i]; + + quad.writeUInt8(au, quadOfs) + quadOfs++; + quad.writeUInt8(av, quadOfs) + quadOfs++; + + quad.writeUInt8(bu, quadOfs) + quadOfs++; + quad.writeUInt8(bv, quadOfs) + quadOfs++; + + quad.writeUInt8(cu, quadOfs) + quadOfs++; + quad.writeUInt8(cv, quadOfs) + quadOfs++; + + quad.writeUInt8(du, quadOfs) + quadOfs++; + quad.writeUInt8(dv, quadOfs) + quadOfs++; + + // Encode the face indices to a dword + quad.writeUInt32LE(dword, quadOfs) + quadOfs += 4 + } + + return { tri, quad, vertices } +} + +const encodeMesh = (obj: string, faceMat: boolean = false): Primitive => { + + const SCALE = 1 / 0.00125; + const ROT_X = new Matrix4(); + ROT_X.makeRotationX(Math.PI); + + // First step is to break the file down into primitives + const lines = obj.split('\n'); + const verts: string[] = []; + const uvs: string[] = []; + const tris: string[] = []; + const quads: string[] = [] + + lines.forEach(line => { + if (line.indexOf('v ') === 0) { + verts.push(line) + } + + if (line.indexOf('vt ') === 0) { + uvs.push(line) + } + + if (line.indexOf('f ') === 0) { + const parts = line.split(' ') + let edge = 0; + parts.forEach(p => { + edge += p.indexOf('/') !== -1 ? 1 : 0 + }) + switch (edge) { + case 3: + tris.push(line) + break; + case 4: + quads.push(line) + break; + default: + throw new Error("Wait, what the fuck? " + line) + break; + } + + } + }) + + const vertices = Buffer.alloc(verts.length * 4, 0) + let vertOfs = 0; + for (let i = 0; i < verts.length; i++) { + // Extract string values for x,y,z + const v = verts[i].split(' '); + const xRaw = parseFloat(v[1]) + const yRaw = parseFloat(v[2]) + const zRaw = parseFloat(v[3]) + + // // Scale and rotate to match psx orientation + const vec3 = new Vector3(xRaw, yRaw, zRaw); + vec3.multiplyScalar(SCALE); + vec3.applyMatrix4(ROT_X); + // vec3.applyMatrix4(ROT_Y); + + // // Round each value to nearest whole int + vec3.x = Math.round(vec3.x) + vec3.y = Math.round(vec3.y) + vec3.z = Math.round(vec3.z) + + // // Encode x,y,z to signed 10 but values + const { x, y, z } = vec3; + + // Shift and merge vertex to make a 32 bit value + const vertex = encodeVertex(x, y, z) + vertices.writeUInt32LE(vertex, vertOfs) + vertOfs += 4 + } + + const PIXEL_TO_FLOAT_RATIO = 0.00390625; + const PIXEL_ADJUSTMEST = 0.001953125; + const pixels: [number, number][] = []; + + for (let i = 0; i < uvs.length; i++) { + // Parse the information from the string + const uv = uvs[i].split(' '); + const uRaw = parseFloat(uv[1]) + // Flip V + const vRaw = 1 - parseFloat(uv[2]) + + // // Approximate the pixel + const uAdjusted = (uRaw / PIXEL_TO_FLOAT_RATIO) - PIXEL_ADJUSTMEST + const vAdjusted = (vRaw / PIXEL_TO_FLOAT_RATIO) - PIXEL_ADJUSTMEST + + // // Eniminate rounding to make sure it's a pixel reference + const uFloor = Math.floor(uAdjusted) + const vFloor = Math.floor(vAdjusted) + + // // Make sure it fits in one byte + const u = uFloor > 255 ? 255 : uFloor < 0 ? 0 : uFloor; + const v = vFloor > 255 ? 255 : vFloor < 0 ? 0 : vFloor; + + // Push the pixels to be referenced + pixels.push([u, v]) + } + + // Encode the triangles for each of the faces + const FACE_MASK = 0x7f; + const tri = Buffer.alloc(tris.length * 12, 0); + let triOfs = 0; + for (let i = 0; i < tris.length; i++) { + const f = tris[i].split(' '); + + const [aStr, aIdx] = f[2].split('/') + const [bStr, bIdx] = f[1].split('/') + const [cStr, cIdx] = f[3].split('/') + + // Obj Indices start at 1 not 0 + const a = parseInt(aStr) - 1 + const b = parseInt(bStr) - 1 + const c = parseInt(cStr) - 1 + + // Same, Obj Indices start at 1 not 0 + const [au, av] = pixels[parseInt(aIdx) - 1]; + const [bu, bv] = pixels[parseInt(bIdx) - 1]; + const [cu, cv] = pixels[parseInt(cIdx) - 1]; + + tri.writeUInt8(au, triOfs) + triOfs++; + tri.writeUInt8(av, triOfs) + triOfs++; + + tri.writeUInt8(bu, triOfs) + triOfs++; + tri.writeUInt8(bv, triOfs) + triOfs++; + + tri.writeUInt8(cu, triOfs) + triOfs++; + tri.writeUInt8(cv, triOfs) + triOfs++; + + tri.writeUInt8(0, triOfs) + triOfs++; + tri.writeUInt8(0, triOfs) + triOfs++; + + // Encode the face indices to a dword + const indexA = a & FACE_MASK + const indexB = b & FACE_MASK + const indexC = c & FACE_MASK + const indexD = 0 + + const materialIndex = faceMat ? 2 : 0; + + // Material Index 0 = Img 0 - Palette 0 + // Material Index 1 = Img 0 - Palette 1 + + const dword = indexA | (indexB << 7) | (indexC << 14) | (indexD << 21) | materialIndex << 28 + tri.writeUInt32LE(dword, triOfs) + triOfs += 4 + } + + console.log(tri); + + const quad = Buffer.alloc(quads.length * 12, 0); + let quadOfs = 0; + for (let i = 0; i < quads.length; i++) { + const f = quads[i].split(' '); + + const [aStr, aIdx] = f[1].split('/') + const [bStr, bIdx] = f[4].split('/') + const [cStr, cIdx] = f[2].split('/') + const [dStr, dIdx] = f[3].split('/') + + // Obj Indices start at 1 not 0 + const a = parseInt(aStr) - 1 + const b = parseInt(bStr) - 1 + const c = parseInt(cStr) - 1 + const d = parseInt(dStr) - 1 + + // Same, Obj Indices start at 1 not 0 + const [au, av] = pixels[parseInt(aIdx) - 1]; + const [bu, bv] = pixels[parseInt(bIdx) - 1]; + const [cu, cv] = pixels[parseInt(cIdx) - 1]; + const [du, dv] = pixels[parseInt(dIdx) - 1]; + + quad.writeUInt8(au, quadOfs) + quadOfs++; + quad.writeUInt8(av, quadOfs) + quadOfs++; + + quad.writeUInt8(bu, quadOfs) + quadOfs++; + quad.writeUInt8(bv, quadOfs) + quadOfs++; + + quad.writeUInt8(cu, quadOfs) + quadOfs++; + quad.writeUInt8(cv, quadOfs) + quadOfs++; + + quad.writeUInt8(du, quadOfs) + quadOfs++; + quad.writeUInt8(dv, quadOfs) + quadOfs++; + + // Encode the face indices to a dword + const indexA = a & FACE_MASK + const indexB = b & FACE_MASK + const indexC = c & FACE_MASK + const indexD = d & FACE_MASK + + const materialIndex = 0; + + // Material Index 0 = Img 0 - Palette 0 + // Material Index 1 = Img 0 - Palette 1 + + const dword = indexA | (indexB << 7) | (indexC << 14) | (indexD << 21) | materialIndex << 28 + quad.writeUInt32LE(dword, quadOfs) + quadOfs += 4 + } + + return { tri, quad, vertices } +} + +const encodeModelBody = ( + bodyObj: string, // filename + hipsObj: string, //filename, + rLegTopObject: string, //filename + rLegBtmObject: string, // filename + lLegTopObject: string, // filename + lLegBtmObject: string // filename +) => { + + const BODY_START = 0x80; + const BODY_END = 0xe80 + const BODY_LEN = BODY_END - BODY_START; + + const prims: Primitive[] = [] + const limbs = [ + readFileSync(bodyObj, 'ascii'), + readFileSync(hipsObj, 'ascii'), + readFileSync(rLegTopObject, 'ascii'), + readFileSync(rLegBtmObject, 'ascii'), + readFileSync(lLegTopObject, 'ascii'), + readFileSync(lLegBtmObject, 'ascii') + ] + + const START_OFS = 0x110; + let shadowPtr = START_OFS + for (let i = 0; i < limbs.length; i++) { + const prim = encodeMesh(limbs[i]); + const { tri, quad, vertices } = prim; + prims.push(prim); + shadowPtr += tri.length; + shadowPtr += quad.length; + shadowPtr += vertices.length; + } + + + const mesh = Buffer.alloc(BODY_LEN, 0x80); + // Need to zero out the header + for (let i = 0; i < START_OFS; i++) { + mesh[i] = 0; + } + let headerOfs = 0; + let contentOfs = START_OFS - BODY_START; + prims.forEach(prim => { + const { tri, quad, vertices } = prim; + const triCount = tri.length / 12; + const quadCount = quad.length / 12; + const vertCount = vertices.length / 4; + + console.log("Vert Count: ", vertCount) + + // Write the header for each primitive + mesh.writeUInt8(triCount, headerOfs + 0) // tris + mesh.writeUInt8(quadCount, headerOfs + 1) // quads + mesh.writeUInt8(vertCount, headerOfs + 2) // verts + mesh.writeUInt8(0, headerOfs + 3) // nop + headerOfs += 4; + + // Triangle Definition Offset + mesh.writeUInt32LE(contentOfs + BODY_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < tri.length; i++) { + mesh[contentOfs++] = tri[i] + } + + // Quad Definition Offset + mesh.writeUInt32LE(contentOfs + BODY_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < quad.length; i++) { + mesh[contentOfs++] = quad[i] + } + + // Vertex Definition Offset + mesh.writeUInt32LE(contentOfs + BODY_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < vertices.length; i++) { + mesh[contentOfs++] = vertices[i] + } + + // Triangle Shadow Offset + mesh.writeUInt32LE(shadowPtr, headerOfs) + headerOfs += 4; + + // Quad Shadow Offset + mesh.writeUInt32LE(shadowPtr, headerOfs) + headerOfs += 4; + }) + + console.log("End Offset: 0x%s", contentOfs.toString(16)) + console.log("Length: 0x%s", BODY_LEN.toString(16)) + + return mesh; +} + + + +const encodeModelFeet = ( + rightFoot: string, // filename + leftFoot: string, //filename, +) => { + + const MESH_START = 0x1a80; + const MESH_END = 0x1f00 + const MESH_LEN = MESH_END - MESH_START; + + const prims: Primitive[] = [] + const limbs = [ + readFileSync(rightFoot, 'ascii'), + readFileSync(leftFoot, 'ascii'), + ] + + const START_OFS = 0x1ab0; + let shadowPtr = START_OFS + for (let i = 0; i < limbs.length; i++) { + const prim = encodeMesh(limbs[i]); + const { tri, quad, vertices } = prim; + prims.push(prim); + shadowPtr += tri.length; + shadowPtr += quad.length; + shadowPtr += vertices.length; + } + + + const mesh = Buffer.alloc(MESH_LEN, 0x80); + // Need to zero out the header + for (let i = 0; i < START_OFS; i++) { + mesh[i] = 0; + } + let headerOfs = 0; + let contentOfs = START_OFS - MESH_START; + prims.forEach(prim => { + const { tri, quad, vertices } = prim; + const triCount = tri.length / 12; + const quadCount = quad.length / 12; + const vertCount = vertices.length / 4; + + console.log("Vert Count: ", vertCount) + + // Write the header for each primitive + mesh.writeUInt8(triCount, headerOfs + 0) // tris + mesh.writeUInt8(quadCount, headerOfs + 1) // quads + mesh.writeUInt8(vertCount, headerOfs + 2) // verts + mesh.writeUInt8(0, headerOfs + 3) // nop + headerOfs += 4; + + // Triangle Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < tri.length; i++) { + mesh[contentOfs++] = tri[i] + } + + // Quad Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < quad.length; i++) { + mesh[contentOfs++] = quad[i] + } + + // Vertex Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < vertices.length; i++) { + mesh[contentOfs++] = vertices[i] + } + + // Triangle Shadow Offset + mesh.writeUInt32LE(shadowPtr, headerOfs) + headerOfs += 4; + + // Quad Shadow Offset + mesh.writeUInt32LE(shadowPtr, headerOfs) + headerOfs += 4; + }) + + console.log("End Offset: 0x%s", contentOfs.toString(16)) + console.log("Length: 0x%s", MESH_LEN.toString(16)) + + return mesh; +} + +const encodeModelLeftArm = ( + m0: string, + m1: string, + m2: string +) => { + + const MESH_START = 0x1f00; + const MESH_END = 0x2c00 + const MESH_LEN = MESH_END - MESH_START; + + const prims: Primitive[] = [] + const limbs = [ + readFileSync(m0, 'ascii'), + readFileSync(m1, 'ascii'), + readFileSync(m2, 'ascii'), + ] + + + const START_OFS = 0x1f48; + let shadowPtr = START_OFS + for (let i = 0; i < limbs.length; i++) { + const prim = encodeMesh(limbs[i]); + const { tri, quad, vertices } = prim; + prims.push(prim); + shadowPtr += tri.length; + shadowPtr += quad.length; + shadowPtr += vertices.length; + } + + + const mesh = Buffer.alloc(MESH_LEN, 0x80); + // Need to zero out the header + for (let i = 0; i < START_OFS; i++) { + mesh[i] = 0; + } + let headerOfs = 0; + let contentOfs = START_OFS - MESH_START; + prims.forEach(prim => { + const { tri, quad, vertices } = prim; + const triCount = tri.length / 12; + const quadCount = quad.length / 12; + const vertCount = vertices.length / 4; + + console.log("Vert Count: ", vertCount) + + // Write the header for each primitive + mesh.writeUInt8(triCount, headerOfs + 0) // tris + mesh.writeUInt8(quadCount, headerOfs + 1) // quads + mesh.writeUInt8(vertCount, headerOfs + 2) // verts + mesh.writeUInt8(0, headerOfs + 3) // nop + headerOfs += 4; + + // Triangle Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < tri.length; i++) { + mesh[contentOfs++] = tri[i] + } + + // Quad Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < quad.length; i++) { + mesh[contentOfs++] = quad[i] + } + + // Vertex Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < vertices.length; i++) { + mesh[contentOfs++] = vertices[i] + } + + // Triangle Shadow Offset + mesh.writeUInt32LE(0x8a8, headerOfs) + headerOfs += 4; + + // Quad Shadow Offset + mesh.writeUInt32LE(0x8a8, headerOfs) + headerOfs += 4; + }) + + console.log("End Offset: 0x%s", contentOfs.toString(16)) + console.log("Length: 0x%s", MESH_LEN.toString(16)) + + return mesh; +} + +const encodeModelRightArm = ( + m0: string, + m1: string, + m2: string +) => { + + const MESH_START = 0x2c00; + const MESH_END = 0x3200 + const MESH_LEN = MESH_END - MESH_START; + + const prims: Primitive[] = [] + const limbs = [ + readFileSync(m0, 'ascii'), + readFileSync(m1, 'ascii'), + readFileSync(m2, 'ascii'), + ] + + + const START_OFS = 0x1f48; + let shadowPtr = START_OFS + for (let i = 0; i < limbs.length; i++) { + const prim = encodeMesh(limbs[i]); + const { tri, quad, vertices } = prim; + prims.push(prim); + shadowPtr += tri.length; + shadowPtr += quad.length; + shadowPtr += vertices.length; + } + + + const mesh = Buffer.alloc(MESH_LEN, 0x80); + // Need to zero out the header + for (let i = 0; i < START_OFS; i++) { + mesh[i] = 0; + } + let headerOfs = 0; + let contentOfs = START_OFS - MESH_START; + prims.forEach(prim => { + const { tri, quad, vertices } = prim; + const triCount = tri.length / 12; + const quadCount = quad.length / 12; + const vertCount = vertices.length / 4; + + console.log("Vert Count: ", vertCount) + + // Write the header for each primitive + mesh.writeUInt8(triCount, headerOfs + 0) // tris + mesh.writeUInt8(quadCount, headerOfs + 1) // quads + mesh.writeUInt8(vertCount, headerOfs + 2) // verts + mesh.writeUInt8(0, headerOfs + 3) // nop + headerOfs += 4; + + // Triangle Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < tri.length; i++) { + mesh[contentOfs++] = tri[i] + } + + // Quad Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < quad.length; i++) { + mesh[contentOfs++] = quad[i] + } + + // Vertex Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < vertices.length; i++) { + mesh[contentOfs++] = vertices[i] + } + + // Triangle Shadow Offset + mesh.writeUInt32LE(0x8a8, headerOfs) + headerOfs += 4; + + // Quad Shadow Offset + mesh.writeUInt32LE(0x8a8, headerOfs) + headerOfs += 4; + }) + + console.log("End Offset: 0x%s", contentOfs.toString(16)) + console.log("Length: 0x%s", MESH_LEN.toString(16)) + + return mesh; +} + +const encodeModelHead = ( + m0: string, // hair + m1: string, // face + m2: string // mouth +) => { + + const MESH_START = 0xe80; + const MESH_END = 0x1a80 + const MESH_LEN = MESH_END - MESH_START; + + const prims: Primitive[] = [] + const limbs = [ + readFileSync(m0, 'ascii'), + readFileSync(m1, 'ascii'), + readFileSync(m2, 'ascii'), + ] + + console.log(limbs[2]); + + + const START_OFS = 0xec8; + + // Encode head + const hd = encodeMesh(limbs[0], false); + prims.push(hd); + + prims.push( + { + vertices: Buffer.from('5f2cde3ba12fde3bb06faf3b00402f39b5a32f3b4ba02f3b007c1f380598bf38fb9bbf38001cfe38a6cfce3b5accce3b506caf3b', 'hex'), + tri: Buffer.from('01101f1b051f00008a8100e03a2b3d363a360000838301a0072f002f03260000078401a03336382b39360000888101a0201b3f103b1f0000830503e0', 'hex'), + quad: Buffer.from('2222201b3a223b1f874181e11e2206221f1b051f08c240e01f1b01101f000002034522a0201b20003f103f0283c402a0', 'hex'), + }) + prims.push( + { + vertices: Buffer.from('0060003bb5a32f3b4ba02f3b2d14103bd317103b00ec4f390598bf38fb9bbf38', 'hex'), + tri: Buffer.from('202b2f2e20360000850100a0102e1f2b1f360000840200a022231f2b1d23000086c201a0', 'hex'), + quad: Buffer.from('06231d23102e1f2b8103a1a03a232f2e2223202b8281a1a0', 'hex'), + } + ) + + + + const mesh = Buffer.alloc(MESH_LEN, 0x80); + // Need to zero out the header + for (let i = 0; i < START_OFS; i++) { + mesh[i] = 0; + } + let headerOfs = 0; + let contentOfs = START_OFS - MESH_START; + prims.forEach(prim => { + const { tri, quad, vertices } = prim; + const triCount = tri.length / 12; + const quadCount = quad.length / 12; + const vertCount = vertices.length / 4; + + console.log("Vert Count: ", vertCount) + + // Write the header for each primitive + mesh.writeUInt8(triCount, headerOfs + 0) // tris + mesh.writeUInt8(quadCount, headerOfs + 1) // quads + mesh.writeUInt8(vertCount, headerOfs + 2) // verts + mesh.writeUInt8(0, headerOfs + 3) // nop + headerOfs += 4; + + // Triangle Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < tri.length; i++) { + mesh[contentOfs++] = tri[i] + } + + // Quad Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < quad.length; i++) { + mesh[contentOfs++] = quad[i] + } + + // Vertex Definition Offset + mesh.writeUInt32LE(contentOfs + MESH_START, headerOfs) + headerOfs += 4; + for (let i = 0; i < vertices.length; i++) { + mesh[contentOfs++] = vertices[i] + } + + // Triangle Shadow Offset + mesh.writeUInt32LE(0x8a8, headerOfs) + headerOfs += 4; + + // Quad Shadow Offset + mesh.writeUInt32LE(0x8a8, headerOfs) + headerOfs += 4; + }) + + + writeFileSync('head_debug.bin', mesh) + console.log("--- Head ----"); + console.log("End Offset: 0x%s", contentOfs.toString(16)) + console.log("Length: 0x%s", MESH_LEN.toString(16)) + + return mesh; +} + +// We should be modifying the instance of the ROM +const replaceInRom = (file: Buffer, filepos: number, ROM: Buffer) => { + const len = Math.ceil(file.length / 0x800); + const segments: Buffer[] = []; + + // First we split the file into segments + for (let i = 0; i < len; i++) { + const start = i * 0x800; + const end = (i + 1) * 0x800 + const stop = file.length < end ? file.length : end; + const segment = file.subarray(start, stop); + segments.push(segment); + } + + // Then copy it over to the ROM + let ofs = filepos; + segments.forEach(segment => { + for (let i = 0; i < 0x800; i++) { + ROM[ofs + i] = segment[i] + } + ofs += 0x930; + }) +} + +const replaceModel = ( + gamefile: Buffer, + bodyBuffer: Buffer, + feetBuffer: Buffer, + leftBuffer: Buffer, + rightBuffer: Buffer, + headBuffer: Buffer, +) => { + + const modded = Buffer.from(gamefile) + const read = gamefile.subarray(0x30) + + let seek = 0xe80; + for (let i = 0; i < 3; i++) { + const triCount = read.readUInt8(seek + 0); + const quadCount = read.readUInt8(seek + 1); + const vertCount = read.readUInt8(seek + 2); + + console.log("%s %s %s", triCount.toString(16), quadCount.toString(16), vertCount.toString(16)) + const triOfs = read.readUInt32LE(seek + 4); + console.log("Tris ofs: 0x%s", triOfs.toString(16), i); + + const quadOfs = read.readUInt32LE(seek + 8); + const vertOfs = read.readUInt32LE(seek + 12); + seek += 0x18; + + if (i === 0) { + continue; + } + + console.log("Reading face: ", i) + const vertices = read.subarray(vertOfs, vertOfs + (vertCount * 4)) + const tri = read.subarray(triOfs, triOfs + (triCount * 12)) + const quad = read.subarray(quadOfs, quadOfs + (quadCount * 12)) + + const prim: Primitive = { + vertices, + tri, + quad + } + + console.log(`{ + vertices: Buffer.from('${vertices.toString('hex')}', 'hex'), + tri: Buffer.from('${tri.toString('hex')}', 'hex'), + quad: Buffer.from('${quad.toString('hex')}', 'hex'), +}`) + + } + + + // Zero out the entire model + for (let i = 0xb0; i < 0x31F0; i++) { + modded[i] = 0; + } + + const BIN_HEADER_SIZE = 0x30; + + + // Replace with our updated model + const bodyOfs = 0x0080 + BIN_HEADER_SIZE + for (let i = 0; i < bodyBuffer.length; i++) { + modded[bodyOfs + i] = bodyBuffer[i] + } + + const headOfs = 0xe80 + BIN_HEADER_SIZE + for (let i = 0; i < headBuffer.length; i++) { + modded[headOfs + i] = headBuffer[i] + } + + const feetOfs = 0x1a80 + BIN_HEADER_SIZE + for (let i = 0; i < feetBuffer.length; i++) { + modded[feetOfs + i] = feetBuffer[i] + } + + const leftOfs = 0x1f00 + BIN_HEADER_SIZE + for (let i = 0; i < leftBuffer.length; i++) { + modded[leftOfs + i] = leftBuffer[i] + } + + const rightOfs = 0x2c00 + BIN_HEADER_SIZE + for (let i = 0; i < leftBuffer.length; i++) { + modded[rightOfs + i] = rightBuffer[i] + } + + return modded; +} + +const doReplace = ( + bodyTexture: string, + faceTexture: string, + // Body Section + bodyObject: string, + hipsObject: string, + rLegTopObject: string, + rLegBtmObject: string, + lLegTopObject: string, + lLegBtmObject: string, + // Feet + rightFootObject: string, + leftFootObject: string, + // Left Arm + leftShoulder: string, + leftArm: string, + leftHand: string, + // Right Arm + rightShoulder: string, + rightArm: string, + rightHand: string, + // Head + hairObject: string, + eyesObject: string, + mouthObject: string +) => { + + // Read the source ROM file + const ROM = readFileSync('/home/kion/.pcsxr/roms/TRACK_01_READONLY.bin') + + // Encode the body and face texture to write to ROM + const srcTexture = readFileSync('pl01t.bin') + const bodyBuffer = readFileSync(bodyTexture); + const faceBuffer = readFileSync(faceTexture); + const modTexture = replaceTexture(srcTexture, bodyBuffer, faceBuffer) + const PL01T_POS = 0x3ebbd8; + replaceInRom(modTexture, PL01T_POS, ROM); + + // Encode the body + const srcModel = readFileSync('pl01p000.bin') + const body = encodeModelBody(bodyObject, hipsObject, rLegTopObject, rLegBtmObject, lLegTopObject, lLegBtmObject); + const feet = encodeModelFeet(rightFootObject, leftFootObject); + const lArm = encodeModelLeftArm(leftShoulder, leftArm, leftHand); + const rArm = encodeModelRightArm(rightShoulder, rightArm, rightHand); + const head = encodeModelHead(hairObject, eyesObject, mouthObject); + const updatedModel = replaceModel(srcModel, body, feet, lArm, rArm, head); + writeFileSync('miku_test.bin', updatedModel.subarray(0x30, 0x1f00 + 0x30)) + + const PL01P000_POS = 0x3d4c58; + replaceInRom(updatedModel, PL01P000_POS, ROM); + + // Write the updated ROM to be tested + writeFileSync('/home/kion/.pcsxr/roms/Mega Man Legends 2 (USA) (Track 1).bin', ROM) +} + +export { doReplace } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index f67b2c6..0000000 --- a/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello via Bun!"); \ No newline at end of file