Particle ッ
อนุภาคหลายพันจุดรวมตัวเป็นตัว ッ ในพื้นที่ 3 มิติ เลื่อนเมาส์ผ่านเพื่อดันให้กระจาย แล้วมันจะกลับเข้าที่เอง — ผมเขียนระบบฟิสิกส์สปริงเองThousands of particles assemble into ッ in 3D space. Sweep the pointer through to push them apart — they spring back home. I wrote the spring physics myself.
ลากเมาส์หรือนิ้วผ่านตัว ッ เพื่อดันอนุภาคให้กระจาย ปล่อยแล้วมันจะค่อยๆ กลับมารวมกัน กดรีเซ็ตเพื่อดูมันประกอบร่างใหม่ตั้งแต่ต้นDrag the pointer or a finger through the ッ to scatter the particles; let go and they drift back. Press reset to watch it assemble from scratch.
- 一
สุ่มจุดจากตัวอักษรPoints sampled from a glyph
วาดตัว ッ ลงบน canvas 2 มิติที่มองไม่เห็น แล้วอ่านพิกเซลเพื่อหาตำแหน่งวางอนุภาค จากนั้นสุ่มความลึกให้แต่ละจุด และเติมฝุ่นรอบๆ ให้ฉากไม่โล่งThe ッ is drawn on an off-screen 2D canvas and its pixels are read to place the particles; each point then gets a random depth, with ambient dust around the glyph.
- 二
ฟิสิกส์สปริงSpring physics
ทุกจุดจำตำแหน่งบ้านของตัวเอง แต่ละเฟรมจะถูกดึงกลับด้วยแรงตามระยะห่าง และหน่วงความเร็วลงเล็กน้อย จึงเด้งกลับแบบนุ่มๆ ไม่สั่นค้างEvery point remembers its home. Each frame it is pulled back in proportion to the distance and its velocity is damped slightly, so it settles softly instead of oscillating.
- 三
ดันด้วยเมาส์ในโลก 3 มิติPushing in 3D
ใช้ Raycaster แปลงตำแหน่งเมาส์บนจอเป็นตำแหน่งในฉาก 3 มิติ แล้วผลักอนุภาคที่อยู่ใกล้ออกไปA Raycaster turns the pointer position on screen into a position in the 3D scene, and nearby particles are pushed away from it.
- 四
เบาเครื่องEasy on the device
Three.js โหลดก็ต่อเมื่อเลื่อนมาใกล้ หยุดวาดเมื่ออยู่นอกจอ จำกัดความละเอียดบนจอเล็ก และไม่เริ่มเลยถ้าผู้ชมตั้งค่าลดการเคลื่อนไหวThree.js only downloads when the stage scrolls near, rendering pauses off-screen, pixel ratio is capped on small screens, and it never starts for visitors who ask for reduced motion.