Loading...
Loading...
Particle cloud Three.js (THREE.Points + BufferGeometry) hội tụ từ vị trí ngẫu nhiên thành hình ảnh/logo theo tiến độ cuộn trang — sample pixel từ canvas ẩn làm toạ độ đích, lerp position theo scroll. Gọi khi user nói "particle image", "hạt hội tụ thành ảnh", "three.js particle scroll", "point cloud morph", "particle cloud biến hình theo scroll", hoặc /threejs-particle-morph. KHÁC `skills/blur` (đó là shader GLSL radial-blur CHUYỂN ẢNH sang ảnh khác trên một plane — đây là particle cloud rời rạc BIẾN HÌNH thành ảnh, kỹ thuật render khác hẳn — PointsMaterial/BufferGeometry, không phải ShaderMaterial trên PlaneGeometry).
npx skill4agent add rheinmir/setup threejs-particle-morphTHREE.PointsBufferGeometryassets/blurscroll-effectsảnh nguồn → canvas ẩn (sampleResolution) → getImageData + stride + alphaThreshold → targets (+ màu) · starts random → scroll → targetProgress → progress (damping) → position = lerp(starts, targets, progress) → PointsMaterial render| Field | Required? | Ý nghĩa | |
|---|---|---|---|
| In | ảnh/logo nguồn ( | không | thiếu → demo tự vẽ chữ mẫu lên canvas ẩn để sample |
| In | | không | tham số khởi tạo |
| In | ràng buộc dự án (được kéo lib ngoài không?) | có | quyết định bản gốc (mặc định) hay |
| Out | component trong dự án | có | file gốc copy nguyên (giữ comment ghi công) hoặc |
| Out | bằng chứng verify | có | ảnh chụp progress 0/0.5/1 + console sạch |
positionparticleCountsampleResolutioninit()threenpm install threeimportmapunpkg.com/three@0.169.0blur<script type="importmap">npm install threeimport * as THREE from 'three'alphaThreshold_buildSamples()playwright-verifyfile://assets/particleCount| Step | Type | Inputs | Action | Outputs/exit | Failure/next |
|---|---|---|---|---|---|
| W01 | judgment | ràng buộc dự án | Chọn nguồn: bản gốc | nguồn đã chọn | không kéo lib ngoài → B01 |
| W02 | effect | link chạy + code | Mở link chạy xem đúng hiệu ứng → copy nguyên file | file trong dự án, còn comment ghi công | — |
| W03 | effect | file | Chỉ sửa nội dung/ảnh/màu (hoặc | component đã adapt | — |
| W04 | deterministic | trang qua HTTP | Verify bằng | 3 ảnh + console sạch | lỗi WebGL/FPS → sửa, lặp W03 |
| W05 | effect | dự án thật | Wire production: xoá importmap, | build chạy | — |
Rheinmir/uiux-asset.html_assets/file://git clone --depth 1 https://github.com/Rheinmir/uiux-asset| Pen gốc — tác giả | Link |
|---|---|
| Scroll-Driven Particle WebGL Image Matrix — ycw | chạy · code |
| GSAP ScrollSmoother and Three.js — cmalven | chạy · code |
| GSAP ScrollTrigger Disintegration Effect — dev_loop | chạy · code |
assets/assets/demo.htmlassets/demo.cssassets/demo.jsimageUrlparticleCountparticleSizeParticleMorphimageUrl<canvas>sampleResolutiongetImageData()strideparticleCountalphaThresholdTHREE.PointsBufferGeometrypositionstartstargetsFloat32Arraygsap-scrolltrigger-pintargetProgressscrollY / (scrollHeight - innerHeight)progresstargetProgressscrollYposition[i] = lerp(starts[i], targets[i], progress)geometry.attributes.position.needsUpdate = truePointsMaterial({ size, sizeAttenuation: true, vertexColors: true })colordestroy()requestAnimationFramescrollresizegeometry.dispose()material.dispose()renderer.dispose()| ID | Kind | Guard | Hành vi | Skip / failure | Rejoin |
|---|---|---|---|---|---|
| B01 | conditional_required | dự án KHÔNG được kéo lib ngoài | dùng | — | W04 |
| B02 | capability_optional | cần cả bộ offline | | có mạng tới gallery → skip | W02 |
playwright-verifyscroll-driven-particle-webgl-image-matrix.htmlassets/demo.jsparticleCountblur