작은 개체들이 거리를 유지하며 방향을 맞추고 한 무리로 함께 회전하는 군집 행동Small agents keep their distance, align heading and turn together as one flock.
개체 120개가 이웃 반경 65px로 정렬하고 분리 반경 18px로 간격을 지키며 6초 동안 한 무리로 회전한다
분리가 약해 한 점에 뭉치거나 최대 속도가 커서 무리가 흩어지고 개체가 화면 밖으로 나간다
기본값은 클립에 쓴 값Defaults are the values used in the clip
| 항목PARAM | 기본DEFAULT | 범위RANGE | 메모NOTE |
|---|---|---|---|
| 개체 수 | 120 | 60~200 | 시드 초기 분포 |
| 이웃 반경 | 65px | 50~90 | 정렬·응집 대상 |
| 분리 반경 | 18px | 12~26 | 밀어냄 |
| 최대 속도 | 80px/s | 60~120 | 고정 dt 1/60 |
| 가중치 | 정렬1.0 응집0.8 분리1.4 | 고정 | 조향력 배율 |
const B = seedBoids(5, 120), frames = [];
for (let k = 0; k < 360; k++) { stepBoids(B, 1/60, { r: 65, sep: 18, vmax: 80, w: [1.0, 0.8, 1.4] }); frames.push(B.map(b => [b.x, b.y, Math.atan2(b.vy, b.vx)])); }
const u = { k: 0 };
tl.to(u, { k: 359, duration: 6, ease: 'none', onUpdate: () => draw(frames[Math.round(u.k)]) }, 0);그대로 붙여 넣는다Paste as is
<대상> 화면에 보이드 군집을 넣어줘. 개체 120개를 시드 5로 배치하고 이웃 반경 65px, 분리 반경 18px, 최대 속도 80px/s, 조향 가중치 정렬 1.0, 응집 0.8, 분리 1.4로 고정 dt 1/60에서 360스텝을 사전 계산해. 6초 동안 재생하고 개체는 길이 10px 삼각형으로 진행 방향을 보게 해. 경계 40px 안쪽에서는 반발 조향을 줘.
Add boid flocking to <target>. Place 120 agents from seed 5 and precompute 360 steps at fixed dt 1/60 with neighbor radius 65px, separation radius 18px, max speed 80px per second, and steering weights alignment 1.0, cohesion 0.8, separation 1.4. Play 6 seconds, drawing each as a 10px triangle facing its heading, with a repulsion steer within 40px of the edges.
<파일>에 boids 시뮬레이션을 추가해. 개체 120(시드 5), 이웃 65px, 분리 18px, vmax 80, 가중치 [1.0,0.8,1.4], 경계 40px 반발, dt=1/60로 360프레임을 사전 계산해 frames[]에 저장. GSAP으로 k를 0→359, 6초 선형 tween. 1초·3초·6초 캡처로 무리가 정렬되어 함께 돌고 화면 밖 개체가 없는지 확인해.
Add a boids simulation to <file>. 120 agents (seed 5), neighbor 65px, separation 18px, vmax 80, weights [1.0,0.8,1.4], 40px edge repulsion, dt=1/60, 360 frames precomputed into frames[]. Tween k 0 to 359 over 6 s linear with GSAP. Capture 1 s, 3 s and 6 s to confirm the flock aligns and turns together with no agents outside the frame.
HyperFrames · ReelForge · Scrolline
개념 출처와 라이선스. 구현은 이 레포에서 새로 씀Concept sources and licenses. Implementations are original to this repo