ai21.net
言語

Three.js ニュートンのゆりかご:Opus と Astra 6 の比較

Three.js ニュートンのゆりかご:Opus と Astra 6 の比較 — 1

プロンプト

Build a complete, single-file HTML/Three.js experience showing an exceptionally beautiful, interactive Newton’s cradle.

Use the attached image as the reference for the recognizable construction: five polished metal balls suspended inside two parallel chrome frames.

The result should feel like a luxury product filmed in a real photography studio, with convincing materials, graceful pendulum motion, and working collision physics.

Open directly into the finished scene. The first rendered frame must already be composed beautifully enough to use as a video thumbnail.

Prioritize three things equally: the beauty of the chrome, the physical construction, and the correctness of the motion.

Create a square, recording-ready composition that adapts to the browser without stretching. Center one substantial Newton’s cradle on a seamless warm-ivory studio surface.

Use a fixed camera positioned mostly in front of the cradle, slightly above the balls and slightly off-center. Show enough depth to distinguish the front and rear frames, while keeping all five balls easy to count.

Use a restrained product-photography perspective, approximately equivalent to a 70mm lens. Avoid a wide-angle appearance.

The cradle should fill most of the image. Leave comfortable margins for the full outward swing on both sides. Neither the balls nor the frame may leave the image during normal operation.

Keep the camera stationary throughout. No orbiting, automatic zoom, camera shake, or cuts.

Construct exactly five identical, perfectly round polished stainless-steel spheres.

At rest, their centers must form one horizontal row, with neighboring spheres touching. Their diameters, masses, and suspension lengths must match.

Use two slender, parallel, inverted-U chrome support frames with rounded corners, positioned in front of and behind the ball row.

Each ball must hang from two fine, taut suspension wires: one connected to the front support and one to the rear support. These wires constrain its motion to the shared vertical swing plane.

Include small, believable attachment details. The wires must connect visibly to the balls and frame.

The support frame and anchors remain completely stationary. Update the suspension geometry from the actual ball positions every frame. Wires must never stretch, disconnect, pass through the spheres, or wave independently.

Choose elegant proportions: substantial spheres, slender tubular supports, and enough suspension length for a satisfying swing. Avoid thick ropes, oversized frames, and a bulky decorative base.

Make the metal look convincingly reflective.

Use physically based metallic materials, high-quality sphere geometry, restrained surface roughness, and a carefully designed reflection environment.

Create large studio-softbox reflections that wrap naturally around the spheres and curved frame. Include broad bright highlights, darker reflected regions, and subtle warm tones from the studio.

The spheres must retain readable volume. Avoid flat gray metal, featureless white balls, plastic shading, and excessive bloom.

Build the reflection environment procedurally inside the file. Do not depend on downloaded HDR images or external texture assets.

Use a large soft key light from the upper-left, gentle fill from the opposite side, and a restrained rim light to define the metal against the background.

Add soft contact shadows beneath the frame and moving shadows beneath the balls. Shadows should follow the motion and help communicate height.

Keep the background uncluttered, with a very subtle ivory gradient. The overall image should feel calm, precise, and expensive.

Implement a working simplified Newton’s cradle simulation.

Represent each sphere as an equal-mass pendulum with an angular position and angular velocity. Gravity must drive the swing. Derive the sphere positions from the pendulum geometry.

Use stable time integration and collision handling that can propagate impacts through the full chain of touching balls.

A fixed timestep with sufficient substeps, event-based impacts, or a suitable constraint-aware solver is acceptable. Choose an approach that remains stable at different rendering frame rates.

Do not animate the balls with unrelated sine waves or a prerecorded sequence. The motion must respond to the simulated state and user input.

The required behavior is:

Release one outer ball. It swings into the row, transfers its motion through the chain, and approximately one ball swings outward at the opposite end.
The outgoing ball returns, strikes the row, and sends the original outer ball outward again.
Release two adjacent balls together from one side. Approximately two balls must swing outward together from the opposite side.
The remaining balls should stay close to their resting positions, allowing small physically plausible movement during impacts.
Motion transfers at contact. The outgoing balls must not begin swinging before the incoming balls reach the row.

Handle the chain of contacts consistently. A single order-dependent collision pass must not produce a different result when the direction reverses.

Collisions should approximately conserve momentum and kinetic energy over the brief impact interval, with small losses. Use gentle damping so the swing amplitude decreases gradually.

The simulation must not gain energy, accelerate indefinitely, visibly interpenetrate, jitter continuously, or send the entire row swinging after every impact.

The balls should accelerate toward the bottom of their arcs and slow naturally near their turning points. Avoid constant-speed swinging.

Start with the leftmost ball raised approximately 35 degrees and the other four hanging at rest. Hold this initial pose briefly, around 0.4 seconds, then release automatically.

The experience must immediately demonstrate the classic alternating motion without requiring a click. Continue running without an automatic reset.

Add a small, elegant control strip near the bottom edge with:

“1 BALL”
“2 BALLS”
Pause / Resume
Reset
“0.25×” slow motion

Keep these controls visually secondary. They must not overlap the cradle or its swing paths.

Selecting “1 BALL” or “2 BALLS” should reset the simulation, raise the corresponding leftmost ball or pair to the same release angle, briefly hold, and release.

Reset should restore and replay the currently selected mode.

Slow motion must scale simulated time while preserving the same physics. It must not change gravity, collision behavior, or suspension geometry.

Allow the user to drag either outer ball outward within its permitted swing plane, then release it. Clamp the drag angle to a sensible maximum, around 45 degrees. Keep its suspension wires taut throughout.

Add an “H” keyboard shortcut to hide or reveal the controls for clean recording.

Keep the experience silent. No music, collision sounds, particles, motion trails, impact flashes, explanatory overlays, large titles, model names, or decorative text.

Deliver one complete HTML file with inline CSS and JavaScript. Use one consistently pinned Three.js version and matching modules if needed.

No build step, backend, external models, external textures, or HDR downloads.

Initialize the renderer, camera, lighting, materials, and starting pose before revealing the canvas. Avoid a visible black startup frame.

Support browser resizing without distorting the scene. Aim for smooth performance on a normal laptop and cap pixel density sensibly.

Before finishing, check that:

Exactly five spheres remain visible and correctly suspended.
The complete frame and maximum swing fit inside the square composition.
One-ball mode transfers approximately one ball at each impact.
Two-ball mode transfers approximately two balls at each impact.
Pause, reset, slow motion, and dragging work.
Chrome reflections remain readable throughout the motion.
The scene appears immediately and produces no runtime errors.

Return the complete working HTML.

日本語訳

非常に美しくインタラクティブなニュートンのゆりかごを見せる、完全な単一ファイルの HTML/Three.js 体験を構築してください。

付属の画像を、一目でそれと分かる構造の基準としてください。2 本の平行なクロームフレームの内側に吊り下げられた 5 個の磨き上げられた金属球です。

完成物は、本物のフォトスタジオで撮影された高級製品のように感じられるべきです。説得力のあるマテリアル、優雅な振り子の動き、そして正しく動作する衝突物理を備えてください。

完成したシーンから直接開くようにしてください。最初にレンダリングされるフレームは、すでに動画サムネイルとして使えるほど美しく構図が決まっていなければなりません。

クロームの美しさ、物理的な構造、動きの正確さという 3 つを同等に優先してください。

正方形で録画に適した構図を作り、引き伸ばされずにブラウザへ適応させてください。継ぎ目のないウォームアイボリーのスタジオ面の中央に、存在感のあるニュートンのゆりかごを 1 台配置してください。

固定カメラを使い、ゆりかごのほぼ正面、球よりわずかに高く、中心からわずかにずらした位置に置いてください。前後のフレームを見分けられるだけの奥行きを見せつつ、5 個の球すべてが数えやすい状態を保ってください。

抑制の効いた物撮りらしいパースペクティブを使い、おおよそ 70mm レンズ相当にしてください。広角に見えることは避けてください。

ゆりかごは画面の大部分を占めるようにしてください。両側への最大の振り出し分だけ、余裕のあるマージンを残してください。通常の動作中に、球もフレームも画面外に出てはいけません。

カメラは最後まで固定したままにしてください。周回、自動ズーム、カメラの揺れ、カットは行わないでください。

同一で完全な球体の研磨ステンレス鋼の球を、ちょうど 5 個構築してください。

静止時には、それぞれの中心が 1 本の水平な列をなし、隣り合う球どうしが接している必要があります。直径、質量、吊り下げ長は一致していなければなりません。

角を丸めた逆 U 字型の細いクローム製支持フレームを 2 本、球の列の前方と後方に平行に配置してください。

各球は、細く張られた 2 本の吊りワイヤー、すなわち前方の支持部に接続する 1 本と後方の支持部に接続する 1 本で吊り下げられていなければなりません。これらのワイヤーは、球の動きを共通の垂直な振り子面内に拘束します。

小さく説得力のある取り付けディテールを含めてください。ワイヤーは球とフレームに目に見える形で接続されていなければなりません。

支持フレームと固定点は完全に静止したままにしてください。吊り下げジオメトリは、フレームごとに実際の球の位置から更新してください。ワイヤーは決して伸びたり、外れたり、球を貫通したり、単独で揺れたりしてはいけません。

優雅な比率を選んでください。存在感のある球、細い管状の支持部、そして満足のいく揺れが得られる十分な吊り下げ長です。太いロープ、大きすぎるフレーム、かさばる装飾的なベースは避けてください。

金属を説得力のある反射感に見せてください。

物理ベースの金属マテリアル、高品質な球のジオメトリ、抑制した表面粗さ、そして慎重に設計した反射環境を使用してください。

球と湾曲したフレームに自然に回り込む、大きなスタジオソフトボックスの映り込みを作ってください。広い明るいハイライト、暗い反射領域、スタジオ由来の微妙な暖色を含めてください。

球は読み取れる立体感を保たなければなりません。平坦な灰色の金属、特徴のない白い球、プラスチックのような陰影、過度なブルームは避けてください。

反射環境はファイル内でプロシージャルに構築してください。ダウンロードした HDR 画像や外部テクスチャアセットに依存してはいけません。

左上からの大きなソフトなキーライト、反対側からの穏やかなフィル、そして背景に対して金属の輪郭を際立たせる抑制したリムライトを使用してください。

フレームの下には柔らかなコンタクトシャドウを、球の下には動く影を加えてください。影は動きに追従し、高さを伝える助けになるべきです。

背景はごちゃつかせず、ごく控えめなアイボリーのグラデーションにしてください。全体の画面は、落ち着きと精密さ、そして高級感を感じさせるべきです。

動作する簡略化されたニュートンのゆりかごのシミュレーションを実装してください。

各球は、角度位置と角速度を持つ等質量の振り子として表してください。揺れは重力によって駆動される必要があります。球の位置は振り子のジオメトリから導出してください。

安定した時間積分と、接触している球の連鎖全体に衝撃を伝播できる衝突処理を使用してください。

十分なサブステップを伴う固定タイムステップ、イベントベースの衝撃、あるいは適切な制約を考慮したソルバーのいずれでも構いません。異なるレンダリングフレームレートでも安定し続ける方式を選んでください。

無関係なサイン波や録画済みのシーケンスで球を動かしてはいけません。動きはシミュレーション状態とユーザー入力に反応しなければなりません。

必要な挙動は次のとおりです。

外側の球を 1 個離します。その球は列へ振り込み、動きを連鎖に伝え、反対側の端でおよそ 1 個の球が外へ振り出します。
振り出した球が戻って列に当たり、最初の外側の球を再び外へ振り出します。
片側から隣り合う 2 個の球を一緒に離します。反対側からは、およそ 2 個の球がそろって外へ振り出さなければなりません。
残りの球は静止位置の近くにとどまり、衝撃の間だけ物理的に無理のない小さな動きを許すようにしてください。
動きは接触の時点で伝わります。振り出される球は、進入してくる球が列に到達する前に揺れ始めてはいけません。

接触の連鎖を一貫して扱ってください。順序に依存する単一の衝突パスが、方向が反転したときに異なる結果を生じてはいけません。

衝突は、短い衝撃の区間において運動量と運動エネルギーを、小さな損失を伴いつつ概ね保存するべきです。穏やかな減衰を使って、揺れの振幅が徐々に小さくなるようにしてください。

シミュレーションは、エネルギーを獲得したり、無限に加速したり、目に見えてめり込んだり、絶えず震えたり、衝撃のたびに列全体を揺らしたりしてはいけません。

球は円弧の最下点に向かって加速し、折り返し点の近くで自然に減速するべきです。等速の揺れは避けてください。

最初は、最も左の球を約 35 度まで持ち上げ、残りの 4 個は静止させて吊り下げておきます。この初期姿勢を 0.4 秒ほど短く保持し、その後は自動で離してください。

クリックを必要とせず、体験はただちに古典的な交互運動を示さなければなりません。自動リセットなしで動作を続けてください。

下端の近くに、小さく上品なコントロールストリップを追加し、次を配置してください。

“1 BALL”
“2 BALLS”
Pause / Resume
Reset
“0.25×” スローモーション

これらのコントロールは視覚的に脇役にとどめてください。ゆりかごやその振り子の軌道と重なってはいけません。

“1 BALL” または “2 BALLS” を選ぶと、シミュレーションをリセットし、対応する最も左の球または 2 個の組を同じリリース角度まで持ち上げ、短く保持してから離すようにしてください。

リセットは、現在選択されているモードを復元して再生し直すべきです。

スローモーションは、同じ物理を保ったままシミュレーション時間を拡大縮小しなければなりません。重力、衝突挙動、吊り下げジオメトリを変えてはいけません。

ユーザーが、許可された振り子面内でどちらか一方の外側の球を外へドラッグし、その後で離せるようにしてください。ドラッグ角度は妥当な最大値、およそ 45 度にクランプしてください。その間も吊りワイヤーは張ったままにしてください。

きれいに録画できるよう、コントロールの表示と非表示を切り替える “H” キーボードショートカットを追加してください。

体験は無音に保ってください。音楽、衝突音、パーティクル、モーショントレイル、衝撃のフラッシュ、説明用のオーバーレイ、大きなタイトル、モデル名、装飾的なテキストは入れないでください。

インラインの CSS と JavaScript を備えた、完全な HTML ファイルを 1 つ納品してください。Three.js は 1 つのバージョンに固定して一貫して使い、必要なら対応するモジュールも使ってください。

ビルド工程、バックエンド、外部モデル、外部テクスチャ、HDR のダウンロードは行わないでください。

キャンバスを表示する前に、レンダラー、カメラ、ライティング、マテリアル、開始姿勢を初期化してください。起動時に黒いフレームが見えることは避けてください。

シーンを歪めずにブラウザのリサイズに対応してください。一般的なノート PC で滑らかな動作を目指し、ピクセル密度は妥当に上限を設けてください。

完了する前に、次を確認してください。

ちょうど 5 個の球が表示され、正しく吊り下げられていること。
フレーム全体と最大の振り幅が正方形の構図に収まっていること。
1 球モードでは、衝撃のたびにおよそ 1 個の球が伝わること。
2 球モードでは、衝撃のたびにおよそ 2 個の球が伝わること。
ポーズ、リセット、スローモーション、ドラッグが機能すること。
動きの間もクロームの映り込みが読み取れること。
シーンが即座に表示され、実行時エラーが出ないこと。

動作する完全な HTML を返してください。

出典

原作者
ivanainai
公開日
2026-10-09(由推文 ID 反解)
原典
元の投稿を見る ↗
収録元
zhuyansen/awesome-opus-5.5-video · 2108625335122026542 · ライセンス未表明