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 體驗,呈現一個極其精美、可交互的牛頓擺。

以所附圖片作爲這一可識別構造的參考:五顆拋光金屬球懸掛在兩個平行的鉻金屬框架內。

成品應像一件在真實攝影棚中拍攝的奢侈品:材質令人信服、擺動優雅,並且碰撞物理能正常工作。

直接打開即進入完成後的場景。第一幀渲染畫面就必須構圖精美,足以直接用作視頻縮略圖。

同等地權衡三件事:鉻金屬的美感、物理構造,以及運動的正確性。

創建正方形、可直接錄製的構圖,能自適應瀏覽器而不被拉伸。將一個體量充足的牛頓擺居中放置於無縫的暖象牙色影棚檯面上。

使用固定機位,主要位於牛頓擺正前方,略高於球體並略微偏離中心。展現足夠的景深,讓前後兩個框架能夠區分,同時保持五顆球都清晰可數。

採用剋制的產品攝影視角,約等效於 70mm 鏡頭。避免廣角觀感。

牛頓擺應佔滿畫面的大部分。兩側留出舒適的邊距,以容納完整的外擺行程。在正常運行過程中,球與框架都不得離開畫面。

全程保持機位靜止。不要環繞、自動變焦、鏡頭抖動或剪輯。

精確構建五顆完全相同、渾圓、拋光的不鏽鋼球體。

靜止時,它們的球心必須位於同一水平線上,相鄰球體彼此接觸。它們的直徑、質量和懸掛長度必須一致。

使用兩個細長、平行、四角圓潤的倒 U 形鍍鉻支撐框架,分別置於球列的前方和後方。

每顆球都必須由兩根纖細而緊繃的懸線吊起:一根連接前支撐,一根連接後支撐。這些懸線將其運動約束在共同的垂直擺動平面內。

加入小而可信的連接細節。懸線必須與球體和框架可見地相連。

支撐框架與錨點保持完全靜止。每一幀都要依據球體的實際位置更新懸掛幾何。懸線永不拉伸、斷開、穿透球體,也不得各自獨立擺動。

選擇優雅的比例:飽滿的球體、纖細的管狀支撐,以及足以產生悅目擺幅的懸掛長度。避免粗繩、過大的框架和笨重的裝飾底座。

讓金屬呈現出可信的反射質感。

使用基於物理的金屬材質、高質量的球體幾何、剋制的表面粗糙度,以及精心設計的反射環境。

營造大型影棚柔光箱的反射,自然地環繞於球體和彎曲框架之上。包含寬闊明亮的高光、較暗的反射區域,以及來自影棚的微妙暖色調。

球體必須保持可辨識的體積感。避免扁平灰暗的金屬、毫無細節的白色球體、塑料感着色以及過度的泛光。

在文件內部以程序化方式構建反射環境。不要依賴下載的 HDR 圖像或外部貼圖資源。

使用來自左上方的大面積柔和主光、來自對側的輕柔補光,以及一盞剋制的輪廓光,讓金屬在背景中凸顯出來。

在框架下方添加柔和的接觸陰影,在球體下方添加移動陰影。陰影應跟隨運動,並有助於傳達高度。

保持背景簡潔,僅帶極微妙的象牙色漸變。整體畫面應顯得平靜、精確而昂貴。

實現一個可正常運行的簡化牛頓擺模擬。

將每顆球表示爲一個等質量擺,帶有角位置與角速度。擺動必須由重力驅動。球體位置需從擺的幾何關係推導得出。

使用穩定的時間積分與碰撞處理,使衝擊能夠沿整條相互接觸的球鏈傳遞。

固定時間步長配合足夠的子步、基於事件的碰撞,或合適的約束感知求解器均可。請選擇一種在不同渲染幀率下都能保持穩定的方案。

不要用無關的正弦波或預錄序列來驅動球體。運動必須響應模擬狀態與用戶輸入。

要求的行爲如下:

釋放一顆外側球。它擺入球列,將運動沿球鏈傳遞,另一端大約有一顆球向外擺出。
擺出的球返回、撞擊球列,並再次將最初的那顆外側球送出。
同時從一側釋放兩顆相鄰的球。對側應大約有兩顆球一同向外擺出。
其餘球應保持在靜止位置附近,允許在撞擊期間出現小幅、物理上合理的移動。
運動在接觸時傳遞。在入射球抵達球列之前,出射球不得開始擺動。

一致地處理整條接觸鏈。單一的、依賴順序的碰撞處理,在方向反轉時不得產生不同結果。

碰撞應在短暫的撞擊區間內近似守恆動量與動能,僅允許小幅損耗。使用輕柔的阻尼,使擺幅逐漸衰減。

模擬不得獲得能量、無限加速、出現可見的相互穿透、持續抖動,或在每次撞擊後讓整排球都擺動起來。

球體應在向弧線底部運動時加速,並在接近折返點時自然減速。避免勻速擺動。

初始時將最左側的球抬高約 35 度,其餘四顆靜止懸垂。短暫保持這一初始姿態,約 0.4 秒,然後自動釋放。

該體驗必須無需點擊即可立即演示經典的交替運動。持續運行,不自動重置。

在底邊附近添加一條小巧優雅的控制條,包含:

“1 BALL”
“2 BALLS”
暫停 / 繼續
重置
“0.25×” 慢動作

將這些控件保持在視覺上的次要地位。它們不得與牛頓擺或其擺動路徑重疊。

選擇“1 BALL”或“2 BALLS”時,應重置模擬,將對應的最左側球或雙球抬升至同一釋放角度,短暫保持後再釋放。

重置應恢復並重放當前選中的模式。

慢動作必須縮放模擬時間,同時保持相同的物理表現。它不得改變重力、碰撞行爲或懸掛幾何。

允許用戶在各自允許的擺動平面內將任一外側球向外拖動,然後釋放。將拖動角度限制在合理上限,約 45 度。全程保持其懸線緊繃。

添加“H”鍵盤快捷鍵,用於隱藏或顯示控制條,以便乾淨錄製。

保持體驗靜音。不要音樂、碰撞音效、粒子、運動拖尾、撞擊閃光、說明性疊層、大標題、模型名稱或裝飾性文字。

交付一個完整的 HTML 文件,內聯 CSS 與 JavaScript。使用同一個固定版本的 Three.js,必要時搭配相應的模塊。

不設構建步驟,不使用後端、外部模型、外部貼圖,也不下載 HDR。

在顯示畫布之前,先初始化渲染器、相機、燈光、材質與起始姿態。避免出現可見的黑色啓動幀。

支持瀏覽器縮放而不使場景變形。目標是在普通筆記本上流暢運行,併合理限制像素密度。

完成之前,檢查以下各項:

恰好五顆球始終保持可見並正確懸掛。
完整的框架與最大擺幅必須容納在正方形構圖內。
單球模式下,每次撞擊大約傳遞一顆球。
雙球模式下,每次撞擊大約傳遞兩顆球。
暫停、重置、慢動作與拖動均正常工作。
鉻金屬反射在運動全程保持清晰可讀。
場景立即出現,且不產生任何運行時錯誤。

返回完整、可運行的 HTML。

溯源

原作者
ivanainai
發佈日期
2026-10-09(由推文 ID 反解)
原始出處
查看原帖 ↗
收錄來源
zhuyansen/awesome-opus-5.5-video · 2108625335122026542 · 未聲明授權