Autoplays a 3d animation of a miku mmd Change model slider for different performance. Model 1 (109 vertexs) has good performance for detail, model 2 (21 vertexs) is for old Chromebooks and model 3 (439 vertex) is for devices with dGPU (6fps on phone and 10fps on desktop without a GPU) only for folks with supercomputers or turbowarp press space to restart at end Select free roam (WASD + arrows + click drag) to not use recorded camera. I wanted to update my baldi miku https://scratch.mit.edu/projects/1189688201 with a better model. I hope i did miku justice after the last time debacle lol The code should easily readable as each sprite are under 2k blocks with camelCase and inline comments #MMD #animations #Miku #Anamanaguchi
Same basic base256 encoded player as before with some minor changes. The latest model has 39 stored vertices xyz, plus 10 reconstructed eye anchors: 123 projected points with 700k json data (armature motion xyz deltas, mouth pose, blinks strength, camera position) across 6,343 frames, old armature data was 410kb. this does armature to vertex weights and verlet physics in real time for the 3 miku models. model 3 uses a normal slow triangle system, but miku suits an anime style that pen capsules work well for. It use the same vmd but has vector eyes and 6 mouths types. The vector eyes (34 drawcount) use my custom ellispe filler https://scratch.mit.edu/projects/881853091 based on @-Jie- pen Ellipse Filler. The mouth is pen line with taped edges (14 drawcount). First i tried @Rhodexa method , , but storage and runtime wasnt good enough or i wasnt as skilled as . I spent far too long getting every drawcount minimized so runs at reasonable speed. I worked on this on and off for about 10 days. Model: The model design is focused using a 3 drawings primitives. Dot [1 drawcount], line [1 drawcount], cones (taper two over lapping lines with a big over-lapping circle at the end [3 drawcount]). The cones can seen on fringe, legs, arms. Ellipses are used in eyes for lens and ellipses geometry. Eyes are made white lens, blue iris, black pupil, white reflection and finally eyeliner eye calc draw command once and draw both eye and they are mirror copy at full body perspective. The eyelid is a big flesh color dot which sorts below fringe and above face barrel lines. The lips are 4 cones and 2 lines with a hex line inner fill with a centre when required. There is slight shading on left and right limbs based on distance to camera. There realtime interpolation between mouth poses. verlet physics for pigtails, tie and curtain bangs. I have not done so detailed draw commanding since my Thomas the tank engine model. Sort: Each limb has defined sort index for dot,line and cone. The limb primitives sort first, then each limb container sorted. All sorts use a basic insertion sort. The sorting need extra help for head fringe eyes overlap but agentic coding is great at that. The 3d engine is customize from 3d engine but no triangles are used as I find triangle pipeline too slow vertex matrix calc, calc normals, bfc, complex sort and finally expensive triangles rendering to do at runtime beyond basic cubes see model 3 as a comparison Average: 134,095 opcodes per VM step. Peak: 148,911. 45 recorded steps; profiling adds overhead, so this is not an FPS measurement. Main hotspot Own opcode share PreRender.prepare_stroke 9.54% Render.drawwire 8.85% Render.draw_line 7.07% PreRender.viewtransform_point 6.75% PreRender.prepare_head 6.44% animation.step_ropes 5.34% animation.skin_bone 5.15% Render.draw_taper 4.59% animation.compose_bone 4.13% PreRender.insertion_sort_depth_order 3.21% Shares exclude callees to avoid double-counting. Overall, projection/sorting/command preparation takes 41.84%, rendering including floor 30.85%, bones/skinning/physics 23.42%, and decoding 3.83%. I used Deepseek flash 4.1 medium, goboscript and gobo-agent for $4.81 credits/cost. Deepseek was really good at coding, logic, re-baking IK physics with blender mmd tools but it was useless at low drawcount model design, efficient fillers and camera work. These i gave up and did manually it doesnt have any training knowledge of these and always want to make slow scanlines as that it what LLMs are trained on. Agentic coding really like making monolithic sprites but I forced it to refactor code to when then when over 2k block which help abstraction and readability. Music: Miku by Anamanaguchi feat. Hatsune Miku Motion: Motion by UT AET Department @ LIM Lab / Ten / Nechronyx / Nabix Mouth data: separate vmd by UT AET Department. Miku Motion Actor / Diane Guo Motion made for Mikufest at Komoricon "miku.fest40" Model 3: from sketchfab by emanueler title is "Low poly Miku Hatsune" 2021 YouTube: