개체가 목표를 향해 방향을 바꾸고 도착 직전에 감속한다.An agent turns toward a target and slows down as it approaches.
개체가 120px 떨어진 목표를 향해 가속하고 마지막 90px에서 속도를 줄여 멈춘다.
목표를 매 프레임 무작위로 바꿔 도착 과정이 보이지 않는다.
기본값은 클립에 쓴 값Defaults are the values used in the clip
| 항목PARAM | 기본DEFAULT | 범위RANGE | 메모NOTE |
|---|---|---|---|
| 이동 시간 | 1.8s | 1.5~3.0s | 120px 이동 기준. 도착 오차가 남으면 종료 후 목표에 고정한다. |
| 최고 속도 | 120px/s | 80~240px/s | 1920x1080 화면의 작은 개체 기준. |
| 감속반경 | 90px | 40~120px | 반경 안에서 희망 속도를 거리 비율로 줄인다. |
| 최대 가속도 | 220px/s² | 120~360px/s² | 목표 방향으로 속도를 바꾸는 정도. |
const clock = { t: 0 }, tl = gsap.timeline({ paused: true });
function sample(t) {
let x = 0, v = 0; const dt = 1 / 120;
for (let i = 0; i < Math.floor(t / dt); i++) {
const d = 120 - x, desired = 120 * Math.min(1, Math.abs(d) / 90) * Math.sign(d);
v += Math.max(-220 * dt, Math.min(220 * dt, desired - v)); x += v * dt;
}
return t >= 1.8 ? 120 : x;
}
tl.to(clock, { t: 1.8, duration: 1.8, ease: 'none', onUpdate: () => gsap.set('.agent', { x: sample(clock.t) }) });그대로 붙여 넣는다Paste as is
<파일>의 <대상>에 목표 추적과 도착을 구현해. 목표는 시작점에서 오른쪽 120px, 시간은 1.8초, 최고 속도는 120px/s, 감속반경은 90px, 최대 가속도는 220px/s²로 정해. 고정 1/120초 간격으로 초기 상태부터 계산하고 paused GSAP 타임라인으로 seek하며 종료 시 목표에 고정해.
Implement seek and arrive for <target> in <file>. Place the target 120px to the right of the starting point and use 1.8 seconds, a maximum speed of 120px/s, a slowing radius of 90px, and a maximum acceleration of 220px/s². Recompute from the initial state at fixed 1/120-second steps, drive playback with a paused GSAP timeline, and pin the agent to the target at the end.
<파일>의 에이전트 이동 장면에 <대상>의 목표 도착을 적용해. 120px 이동에 1.8초, 최고 속도 120px/s, 감속반경 90px, 최대 가속도 220px/s²를 쓰고 매 seek에서 초기 상태부터 재계산해. 0.3초, 1.2초, 1.8초 캡처로 방향, 감속, 최종 도착을 확인하고 역순 seek에서도 위치가 같은지 검증해.
Apply seek and arrive to <target> in the agent movement scene in <file>. Use a 120px displacement over 1.8 seconds, a maximum speed of 120px/s, a 90px slowing radius, and a maximum acceleration of 220px/s²; recompute from the initial state on each seek. Capture at 0.3, 1.2, and 1.8 seconds to check direction, deceleration, and final arrival, then verify matching positions when seeking backward.
HyperFrames · ReelForge · Scrolline
개념 출처와 라이선스. 구현은 이 레포에서 새로 씀Concept sources and licenses. Implementations are original to this repo