여러 점이 서로 끌어당기며 작은 무리와 회전 궤도를 만드는 다체 중력 시뮬레이션Many points attract one another and form small clusters and orbiting groups.
점 250개가 중력 상수 0.8로 서로 당기며 5초 동안 작은 무리 2~3개와 소용돌이 궤도로 모인다
완화 반경이 없어 근접한 점이 튕겨 나가며 화면 밖으로 사라지거나 스텝이 커서 에너지가 폭주한다
기본값은 클립에 쓴 값Defaults are the values used in the clip
| 항목PARAM | 기본DEFAULT | 범위RANGE | 메모NOTE |
|---|---|---|---|
| 점 수 | 250 | 120~400 | 시드 초기 분포 |
| 중력 상수 | 0.8 | 0.4~1.2 | 거리 제곱 반비례 |
| 완화 반경 | 12px | 8~20px | 근접 폭주 방지 |
| 스텝 | 8.33ms | 4~16ms | 고정 dt 120Hz |
| 지속 | 5s | 3~8s | 사전 계산 600스텝 |
let s = seedBodies(3, 250); const frames = [];
for (let k = 0; k < 600; k++) { for (let sub = 0; sub < 1; sub++) step(s, 1/120, 0.8, 12); frames.push(s.map(b => [b.x, b.y])); }
const u = { k: 0 };
tl.to(u, { k: 599, duration: 5, ease: 'none', onUpdate: () => draw(frames[Math.round(u.k)]) }, 0);
// step: a_i = sum G*(rj-ri)/(|d|^2+eps^2)^(3/2), 세미 임플리시트 오일러그대로 붙여 넣는다Paste as is
<대상> 화면에 다체 궤도 군집을 넣어줘. 점 250개를 시드 3으로 원반 분포에 두고, 중력 상수 0.8, 완화 반경 12px, 고정 dt 1/120로 600스텝을 사전 계산해 표로 저장해. 5초 동안 인덱스만 선형 재생하고, 점은 반경 2px 흰색 불투명도 0.8, 속도가 빠를수록 청록으로 물들게 해.
Add an N-body orbital cluster to <target>. Place 250 points in a disc distribution from seed 3 and precompute 600 steps into a table with gravity constant 0.8, softening radius 12px and fixed dt of 1/120. Play the index linearly over 5 seconds, drawing points as 2px white at 0.8 opacity, tinting teal as speed increases.
<파일>에 N-body 시뮬레이션을 추가해. 점 250개(시드 3), a_i=Σ0.8*(rj-ri)/(|d|²+12²)^1.5, 세미 임플리시트 오일러 dt=1/120로 600프레임을 사전 계산해 frames[]에 저장. GSAP으로 k를 0→599, 5초 선형 tween. 0.5초·2.5초·5초 캡처로 점이 무리로 모이고 화면 밖으로 탈출한 점이 10% 미만인지 확인해.
Add an N-body simulation to <file>. 250 points (seed 3), a_i = sum 0.8*(rj-ri)/(|d|^2+12^2)^1.5, semi-implicit Euler at dt=1/120, 600 frames precomputed into frames[]. Tween k 0 to 599 over 5 s linear with GSAP. Capture 0.5 s, 2.5 s and 5 s to confirm points gather into clusters and fewer than 10 percent escape the frame.
HyperFrames · ReelForge · Scrolline
개념 출처와 라이선스. 구현은 이 레포에서 새로 씀Concept sources and licenses. Implementations are original to this repo