ANIMATION · Vite + three
曲线路径与 TubeGeometryCurve path and tube geometry
CatmullRomCurve3 定义路径,TubeGeometry 可视化轨道,物体沿 curve 运动。
旗舰完整演示
可交互场景(拖拽旋转;部分演示支持键盘)。下方提示词用于让 Agent 生成同级成品。
预期产出 · Returns
Vite:管道网格 + 小球沿参数 t 运动,可暂停与调节速度。
适合用在哪
漫游路径预览、管道、传送带、镜头运动草图。
容易踩的坑
- getPointAt 与 getTangent 需同一 curve 参数化。
提示词 · Prompt
Vite + Three.js:
1) 至少 4 个 Vector3 控制点构成 CatmullRomCurve3;
2) TubeGeometry 沿曲线绘制管道;
3) 小球 getPointAt(t) 运动,t 循环 0-1;
4) 可选 camera 跟随小球切线方向;
5) GUI 调节 tube 半径与速度;
6) 中文注释 curve 参数化含义。
输出代码。
Vite CatmullRom curve, TubeGeometry, object animated along t, optional camera follow.