ai21.net
言語

部屋からクォークまでズームする3Dシーン

部屋からクォークまでズームする3Dシーン — 1部屋からクォークまでズームする3Dシーン — 2

プロンプト

INFINIZOOM

Build infinizoom: a procedural infinite-zoom world. The deliverable is a
self-contained BunJS project. Running `bun run server` must build and serve it
(wire up the corresponding "server" script in package.json). Three local assets
exist in this directory and must be used: ./macbook_interior.png (a real MacBook
Pro teardown photo), ./apple_m4_scheme.png (Apple's M4 die floorplan diagram),
and ./wallpaper.jpg (a 1920×1200 desktop wallpaper photo). Load the wallpaper
from this local file — never fetch content from external servers (the sole
exception: three.js itself may be imported from a CDN by URL).

The world

A single 3D world is traveled indefinitely along a fixed camera track that zooms
through these levels:

Main route: a room → a desk → a MacBook Pro → inside the chassis → the logic
board → the Apple M4 package → the M4 die → a performance core → an integer ALU
block → a standard logic cell → a FinFET transistor → a material cross-section
inside the fin → the silicon crystal lattice → one unit cell → an atom → its
nucleus → a nucleon → a quark. Logic gates and circuits (AND, OR, etc.) should
be animated as it computes.

Screen branch: exactly one bifurcation, hovering above the MacBook. Choosing the
other side dives into the display instead: the screen → the display panel →
pixel tiles → a pixel block → one pixel → its R/G/B sub-pixel LEDs → the
emissive layer → an emitter molecule → and converges to the same atom → nucleus
→ nucleon → quark tail. The leds must be accurate: 1-to-1 mapping from screen
pixels to leds, and their colors must match the color of that pixel. The screen
is animated and the LEDs are updated to match the animation in real time.

Riding the track forward IS zooming in; riding backward is zooming out. The
design must extend additively: adding a new structure = one render function +
one call in its parent; adding a bifurcation = one more route; a future backward
extension (t < 0: out the window → city → planet → universe) must require only
prepending track levels. A time parameter must be threaded through everything so
all animation stays possible at any depth.

Architecture (hard constraints)

- Mutable state is EXACTLY: one float t (position along the track), one branch
  bitstring (0 = left/A, 1 = right/D; a bit is pushed when passing a fork and
  popped when backing out below it), and raw input (keys held, mouse position).
  Every frame is a pure function of (t, branches, raw input, wall-clock time).
  No other state — no scene graph, no node objects, no stored world data, no
  caches of world structure.
- Renderers are pure functions that call their children directly: render_room()
  calls render_desk() calls render_macbook() … down to render_quark(). No
  dispatch layer, no classes. The call stack is the scene traversal.
- Scale-space warping via local unit frames: floats cannot hold meters and
  femtometers at once, so every renderer works in its own ~unit-sized local
  frame, and the camera is re-expressed into each child frame. Geometry math is
  done camera-relative in doubles, cast to float only at the very end, so the
  picture is artifact-free across all ~17 decades of scale. The exact same
  layout constants must place structures for rendering AND author the track —
  one source of truth, or the camera drifts visibly off the line.
- Immediate-mode rendering over three.js: every frame, the recursion emits
  primitives into instanced pools; three.js is only a rasterizer. Nothing
  off-screen or sub-pixel is emitted or recursed into.

The track and the camera

- Speed: fast. The whole main ride should take roughly 20 seconds, with a
  comfortable, constant-feeling time per level (exponential zoom feel) and
  gentle easing near the fork and the track ends.
- Shape: gently curved arcs. Not wandering, roundabout, or random-direction —
  but also NOT dead-straight rays. Soft, purposeful curves.
- The green line: the track is always visible in-scene as a translucent green
  line. It must be an infinitesimal line: ~2 pixels wide on screen at EVERY
  distance, implemented as a true GL line primitive (not tubes, not rods, not
  meshes of any kind), transparent (never rock-solid), and it must NEVER grow
  wider as it approaches or passes the camera — it is literally a path line,
  visible both near and far.
- The camera must never look at nothing. At every instant of the ride the view
  must be filled with structure. Concretely: every level approach is a diagonal
  glide (roughly 45°) over the parent surface — never a low horizontal skim
  (which puts empty void in the upper half of the screen) and never a
  straight-down drop (which degenerates the camera roll). Every level must
  render rich, non-uniform content at the distance where the camera arrives —
  never a flat gray plate.
- Dive points land dead-center inside meaningful sub-structures. The line must
  enter the CENTER of one of the small colored squares (a specific core on the
  die, a specific block in the core, a specific pixel on the screen) — never a
  border, edge, gap, seam, or gray filler zone. The boundary transitions between
  levels (e.g. performance core → integer ALU block, "100 µm across") must be
  scrutinized: the camera must be looking at detailed structure the whole way
  through.
- Occlusion never pops: every shell the camera is about to pierce (the keyboard
  deck, the transistor's gate, the LED's cathode, the screen's cover glass…)
  fades away smoothly as a pure function of t shortly before the camera reaches
  it, and fades back identically when riding out.

Controls and HUD

- W rides deeper, S rides back.
- At the bifurcation: a big translucent ‹ on the left edge and › on the right
  edge of the screen, each labeled with its key (A / D), with the currently
  selected side highlighted/glowing. No sentence-style instruction text.
- Mouse moves the glance direction with a full 360° range — the rider can look
  all the way around, including behind.
- A title at the top-left always names where we are right now (e.g. "performance
  core") together with the current physical scale ("3.2 mm across").

Content — fidelity and density

Everything must be densely detailed — think "10× more detail than feels
sufficient" — and hiding must be un-aggressive: distant and peripheral objects
stay visible; more detail is always preferred over less. Everything plausible
must be animated and alive.

- The room and desk: a believable day-lit room (window, curtains, floor, walls,
  shelf, chair, door, rug, a wall clock whose hands actually run, lamps, cables)
  and a believable desk (the MacBook, a potted plant, paper, a mug, books,
  phone, pens…).
- The MacBook exterior: correct proportions, full keyboard with per-key legends,
  trackpad, ports, hinge, screen bezel with notch and camera.
- The MacBook interior: there are many components inside a MacBook — reproduce
  them in pixel-perfect locations matching ./macbook_interior.png: the two fans
  (with visibly SPINNING, clearly readable impeller blades — use few chunky
  blades, not a dense blur), the S-curved heat pipe and heat spreader, the black
  logic board carpeted in passives with EMI shields and chips, the antenna bar
  along the hinge, side port boards, the 4-corner + 2-tall-center battery cell
  layout with printed labels, aluminum struts, the trackpad flex cable running
  down the middle to its gold connector, the flanking speakers, tape, thermal
  pads, screws — all of it.
- The M4 die: block placement faithful to ./apple_m4_scheme.png (4 P-cores +
  shared L2, 6 E-cores + L2, 10 GPU cores, 16 Neural Engine cores, SLC,
  media/display engines, ISP, Secure Enclave, memory PHYs on the edges), with no
  bare/gray substrate anywhere — every area is a labeled block, and blocks show
  interior sub-structure at every intermediate zoom. The CPU interior (core
  floorplan: caches, decoders, schedulers, ALUs, FP units, register files…) must
  be greatly detailed, not a few flat rectangles.
- Digital circuits doing operations — explicitly a top-priority feature: the
  zoom must pass through logic that is visibly COMPUTING. Standard cells are
  real gates (AND/OR/NAND/NOR/XOR/NOT): their input nets carry live 0/1 signals
  (bright = 1, dark = 0), their output is the actual boolean function of the
  inputs, pulses race along wires when gates switch, and whole logic blocks
  twinkle with switching activity at every zoom level.
- Animated electronic simulation: the FinFET's gate runs a live drive waveform,
  and while it is open, charge carriers visibly flow from source to drain.
  Continue through real materials: gate oxide, dopants, the diamond-cubic
  silicon lattice at its true 0.543 nm pitch, into atoms with orbiting
  electrons, a nucleus with protons/neutrons and an animated gluon field, down
  to quarks.
- The screen must be REAL: a real image at real MacBook-panel fidelity — the
  bundled ./wallpaper.jpg photo as the desktop background, with a procedurally
  drawn OS on top (menu bar, dock with recognizable icons, overlapping
  application windows: a code editor with syntax-colored lines, a file browser,
  a terminal with a blinking cursor, and a video window that visibly plays,
  animating at full frame rate). Never a mosaic of colored squares. All levels
  of the screen (full panel → tiles → pixels → sub-pixel brightness) must sample
  the SAME image function so content never changes across zoom, and detail must
  increase strictly monotonically as the camera approaches — at no zoom distance
  may the screen become LESS detailed than it was a moment before.
- The sub-pixel LEDs: each LED is lit by the ACTUAL channel value of the
  on-screen image at that exact pixel — realistic and accurate, not default
  colors. Because the screen animates, the LEDs visibly CHANGE color over time.
  The dive targets a pixel inside the playing video, where R, G and B clearly
  differ from each other and keep changing. Inside, an LED is not a solid: model
  the full OLED stack — the TFT drive circuit with its data/scan lines and
  storage capacitor, the reflective anode, transport layers, the emission layer,
  the semi-transparent cathode, auxiliary wiring, spacers, encapsulation — with
  a live simulation: holes drift up, electrons drift down, they recombine in the
  emission layer with a flash, and photons fly up and out. Below that, the
  emissive layer resolves into a molecular film, then a single emitter molecule
  built of real atoms, joining the shared atomic tail.

Visual-quality laws

- Nothing ever pops, flickers, or z-fights — anywhere, at any scale, moving in
  either direction. In particular: never emit overlapping coplanar surfaces or
  nested coincident translucent volumes; and any material exempted from fog
  (emissive screens, glass, glow) must still be manually distance-faded and
  culled, or shells belonging to enclosing structures will haunt the camera at
  deep zooms as giant flickering planes.
- All LOD transitions are smooth morphs or strictly-finer refinements of
  identical content — never a swap to something coarser, blurrier, or
  differently colored.
- Spinning/periodic animations must be tuned to be perceptible (no temporal
  aliasing that freezes or scrambles them).
- Runs at 60 fps.

Code Quality

Ensure your implementation is concise, minimal, elegant. Use pure functions as
much as possible. Keep it very Haskell-like, even though it is TypeScript. Most
of the complexity of the function comes from the different objects that are
rendered, and each object is a render function. Each renderable object must live
in its own file at src/render/<name>.ts — that directory is the one that scales
as we add more renderables. Organize the project such that it can scale by just
adding more render functions/files under src/render/. Avoid unnecessary
complexity.

日本語訳

INFINIZOOM

infinizoom を作れ:手続き的に生成される無限ズームの世界。成果物は
自己完結型の BunJS プロジェクトである。`bun run server` を実行するとビルドして配信しなければならない
(package.json の対応する "server" スクリプトを接続せよ)。このディレクトリには三つの
ローカルアセットがあり、必ず使用しなければならない:./macbook_interior.png(実在の MacBook
Pro の分解写真)、./apple_m4_scheme.png(Apple の M4 ダイのフロアプラン図)、
そして ./wallpaper.jpg(1920×1200 のデスクトップ壁紙写真)。壁紙は
このローカルファイルから読み込め — 決して外部サーバーからコンテンツを取得するな(唯一の
例外:three.js 自体は URL により CDN からインポートしてよい)。

世界

単一の 3D 世界を、次のレベルをズームで通り抜ける固定されたカメラトラックに沿って
無限に移動する:

主経路:部屋 → 机 → MacBook Pro → シャーシ内部 → ロジック
ボード → Apple M4 パッケージ → M4 ダイ → パフォーマンスコア → 整数 ALU
ブロック → 標準ロジックセル → FinFET トランジスタ → フィン内部の
材料断面 → シリコン結晶格子 → 一つの単位セル → 原子 → その
原子核 → 核子 → クォーク。論理ゲートと回路(AND、OR など)は
計算している様子がアニメーション化されるべきである。

画面分岐:分岐点はちょうど一つで、MacBook の上に浮かんでいる。反対の
側を選ぶと、代わりにディスプレイへ飛び込む:画面 → ディスプレイパネル →
ピクセルタイル → ピクセルブロック → 一つのピクセル → その R/G/B サブピクセル LED →
発光層 → 発光体分子 → そして同じ原子 → 原子核
→ 核子 → クォークの尾へと収束する。LED は正確でなければならない:画面上の
ピクセルから LED への 1 対 1 マッピングであり、その色はそのピクセルの色と一致しなければならない。画面は
アニメーションし、LED はリアルタイムでそのアニメーションに合わせて更新される。

トラックを前へ進むことはズームインそのものであり、後ろへ進むことはズームアウトである。設計は
加算的に拡張できなければならない:新しい構造の追加 = レンダー関数一つ +
親での呼び出し一つ;分岐の追加 = ルートをもう一つ;将来の後方
拡張(t < 0:窓の外へ → 都市 → 惑星 → 宇宙)は、トラックレベルの
先頭への追加だけを必要とすべきである。時間パラメータをすべてに通し、
どの深さでもすべてのアニメーションが可能なままでなければならない。

アーキテクチャ(厳格な制約)

- 可変状態は厳密に次のとおり:float 一つ t(トラックに沿った位置)、分岐
  ビット列一つ(0 = 左/A、1 = 右/D;フォークを通過するときにビットがプッシュされ、
  その下へ戻るときにポップされる)、そして生の入力(押されているキー、マウス位置)。
  すべてのフレームは (t, 分岐, 生入力, 実時間) の純関数である。
  他の状態は一切ない — シーングラフも、ノードオブジェクトも、保存された世界データも、
  世界構造のキャッシュもない。
- レンダラーは子を直接呼び出す純関数である:render_room() が
  render_desk() を呼び、render_macbook() を呼び … render_quark() まで続く。ディスパッチ
  層もクラスもない。コールスタックがシーン走査そのものである。
- ローカル単位フレームによるスケール空間ワープ:float はメートルと
  フェムトメートルを同時に保持できないため、すべてのレンダラーは自身のおよそ単位サイズの
  ローカルフレームで動作し、カメラは各子フレームへ再表現される。ジオメトリ計算は
  double でカメラ相対的に行い、最後にだけ float へキャストするため、
  画像は約 17 桁のスケール全体でアーティファクトがない。まったく同じ
  レイアウト定数が、レンダリング用の構造配置とトラックの作成の両方を
  担わなければならない — 単一の真実の源でなければ、カメラは目に見えて線から外れる。
- three.js 上の即時モードレンダリング:毎フレーム、再帰が
  プリミティブをインスタンスプールへ出力する;three.js はラスタライザにすぎない。画面外や
  サブピクセルのものは出力も再帰もしない。

トラックとカメラ

- 速度:速く。主要な旅全体はおよそ 20 秒かかり、レベルあたり
  快適で一定に感じられる時間(指数的なズーム感)と、
  フォークとトラックの端付近での穏やかなイージングを備える。
- 形状:緩やかに湾曲した弧。さまようでも、回り道でも、ランダムな方向でもなく —
  かといって完全に直線の光線でもない。柔らかく意図的な曲線。
- 緑の線:トラックはシーン内で半透明の緑の線として常に見える。
  それは極細の線でなければならない:あらゆる距離で画面上およそ 2 ピクセル幅、
  真の GL ラインプリミティブとして実装され(チューブではなく、棒ではなく、いかなる種類の
  メッシュでもない)、透明で(決して岩のように固くならず)、カメラに近づいたり
  通過したりしても決して太くなってはならない — 文字どおりの経路線であり、
  近くでも遠くでも見える。
- カメラは決して何もない場所を見てはならない。旅のあらゆる瞬間、視界は
  構造で満たされていなければならない。具体的には:各レベルへの接近は親表面の上を
  斜めに滑空する動き(およそ 45°)である — 低い水平の掠め(画面の上半分に
  何もない空間を残す)は決してなく、真下への落下(カメラのロールが退化する)も
  決してない。各レベルは、カメラが到着する距離で豊かで非一様なコンテンツを
  レンダリングしなければならない — 平らな灰色の板では決してない。
- ダイブポイントは意味のあるサブ構造のど真ん中に着地する。線は、小さな色付き
  正方形の一つの中心へ入らなければならない(ダイ上の特定のコア、コア内の特定の
  ブロック、画面上の特定のピクセル) — 境界、端、隙間、継ぎ目、灰色の充填領域では
  決してない。レベル間の境界遷移(例:パフォーマンスコア → 整数 ALU ブロック、
  「幅 100 µm」)は精査されなければならない:カメラはその全行程を通じて
  詳細な構造を見ていなければならない。
- オクルージョンは決してポップしない:カメラが突き抜けようとするすべてのシェル
  (キーボードデッキ、トランジスタのゲート、LED のカソード、画面のカバーガラス…)は、
  カメラがそれに到達する少し前に t の純関数として滑らかに消え、
  外へ戻るときに同一に再び現れる。

操作と HUD

- W はより深く進み、S は戻る。
- 分岐点では:画面の左端に大きな半透明の ‹、右端に › があり、
  それぞれ対応するキー(A / D)が表示され、現在選択されている側が
  強調/発光している。文章形式の説明テキストはない。
- マウスは視線の向きを 360° の全範囲で動かす — ライダーは
  背後を含め、周囲全体を見渡せる。
- 左上のタイトルは、今どこにいるのか(例:「パフォーマンスコア」)と、
  現在の物理スケール(「幅 3.2 mm」)を常に示す。

コンテンツ — 忠実度と密度

すべては密に細部まで描かれなければならない — 「十分だと感じるより 10 倍細かい」と
考えよ — そして隠蔽は攻撃的であってはならない:遠くの物体や周辺の物体は
見えたままであり、細部は常に少ないより多いほうが好ましい。もっともらしいものはすべて
アニメーションし、生き生きとしていなければならない。

- 部屋と机:説得力のある日当たりのよい部屋(窓、カーテン、床、壁、
  棚、椅子、ドア、ラグ、針が実際に動く掛け時計、ランプ、ケーブル)
  と、説得力のある机(MacBook、鉢植え、紙、マグカップ、本、
  電話、ペン…)。
- MacBook の外観:正確な比率、キーごとに刻印のあるフルキーボード、
  トラックパッド、ポート、ヒンジ、ノッチとカメラを備えた画面ベゼル。
- MacBook の内部:MacBook の内部には多くの部品がある — ./macbook_interior.png に
  一致するピクセル単位で正確な位置にそれらを再現せよ:二つのファン
  (目に見えて回転し、はっきり読み取れるインペラブレード — 密なぼかしではなく、
  少数の分厚いブレードを使え)、S 字に曲がったヒートパイプとヒートスプレッダ、黒い
  ロジックボード(EMI シールドとチップを備えたパッシブ部品が敷き詰められている)、
  ヒンジに沿ったアンテナバー、側面のポートボード、印刷ラベルの付いた
  四隅+中央縦長二つのバッテリーセル配置、アルミニウムの支柱、
  中央を下って金のコネクタへ至るトラックパッドフレックスケーブル、
  両脇のスピーカー、テープ、サーマルパッド、ネジ — そのすべて。
- M4 ダイ:./apple_m4_scheme.png に忠実なブロック配置(4 個の P コア+
  共有 L2、6 個の E コア+L2、10 個の GPU コア、16 個の Neural Engine コア、SLC、
  メディア/ディスプレイエンジン、ISP、Secure Enclave、端にあるメモリ PHY)で、
  どこにも露出した/灰色の基板がない — すべての領域はラベルの付いたブロックであり、
  ブロックはすべての中間ズームで内部のサブ構造を示す。CPU 内部(コア
  フロアプラン:キャッシュ、デコーダ、スケジューラ、ALU、FP ユニット、レジスタファイル…)は
  大幅に詳細でなければならず、平らな長方形をいくつか並べただけではいけない。
- 演算するデジタル回路 — 明示的に最優先の機能である:ズームは
  目に見えて計算している論理を通過しなければならない。標準セルは
  本物のゲートである(AND/OR/NAND/NOR/XOR/NOT):その入力ネットは生きた 0/1 信号を
  運び(明るい = 1、暗い = 0)、出力は入力の実際のブール関数であり、
  ゲートが切り替わるとパルスが配線を駆け抜け、論理ブロック全体が
  あらゆるズームレベルでスイッチング活動でまたたく。
- アニメーションする電子シミュレーション:FinFET のゲートは生きた駆動波形を
  走らせ、それが開いている間、電荷キャリアがソースからドレインへ目に見えて流れる。
  実際の材料を通り抜けよ:ゲート酸化膜、ドーパント、真の 0.543 nm ピッチの
  ダイヤモンド立方晶シリコン格子、軌道電子を持つ原子、陽子/中性子と
  アニメーションするグルーオン場を持つ原子核、そしてクォークまで。
- 画面は本物でなければならない:実際の MacBook パネルに匹敵する忠実度の実画像 —
  同梱の ./wallpaper.jpg 写真をデスクトップ背景とし、その上に手続き的に
  描いた OS を重ねる(メニューバー、見覚えのあるアイコンを備えた Dock、
  重なり合うアプリケーションウィンドウ:構文色分けされた行を持つコードエディタ、
  ファイルブラウザ、点滅するカーソルを持つターミナル、そして目に見えて再生され、
  フルフレームレートでアニメーションするビデオウィンドウ)。決して色付き正方形の
  モザイクではない。画面のすべてのレベル(パネル全体 → タイル → ピクセル →
  サブピクセル輝度)は同じ画像関数をサンプリングしなければならないため、
  ズームしてもコンテンツは決して変わらず、細部はカメラが近づくにつれて
  厳密に単調増加しなければならない — どのズーム距離でも、画面が直前より
  ディテールに乏しくなってはならない。
- サブピクセル LED:各 LED は、その正確なピクセルにおける画面上の画像の
  実際のチャネル値で点灯する — リアルで正確であり、既定の色ではない。画面が
  アニメーションするため、LED は時間とともに目に見えて色が変わる。
  ダイブは再生中のビデオ内のピクセルを狙い、そこでは R、G、B がはっきりと
  互いに異なり、変化し続けている。内部では、LED は固体ではない:OLED
  スタック全体をモデル化せよ — データ/スキャン線と保持容量を備えた TFT 駆動回路、
  反射アノード、輸送層、発光層、半透明カソード、補助配線、スペーサー、
  封止 — そして生きたシミュレーション:正孔は上へドリフトし、電子は下へ
  ドリフトし、それらは発光層で閃光とともに再結合し、光子は上へ、そして外へ飛び出していく。
  その下では、発光層が分子の膜へと分解し、続いて実在の原子で構成された
  単一の発光体分子となり、共有された原子の尾に合流する。

視覚品質の法則

- 何もポップしたり、ちらついたり、z ファイティングしたりしない — どこでも、どの
  スケールでも、どちらの方向に動いても。特に:重なり合う同一平面上の面や、
  入れ子状に一致する半透明のボリュームを決して出力しない;またフォグから
  除外された素材(発光画面、ガラス、グロー)も依然として手動で距離フェードと
  カリングを行わなければならない。そうでなければ、囲んでいる構造に属する
  シェルが深いズームで巨大なちらつく平面としてカメラにつきまとうだろう。
- すべての LOD 遷移は滑らかなモーフか、同一コンテンツの厳密により細かい改良である —
  より粗いもの、よりぼやけたもの、異なる色のものへの差し替えは決してない。
- 回転/周期的なアニメーションは知覚できるように調整されなければならない
  (それらを凍結させたり乱したりする時間的エイリアシングはない)。
- 60 fps で動作する。

コード品質

実装は簡潔で、最小限で、エレガントであることを確保せよ。可能な限り純粋関数を
使え。TypeScript であっても、非常に Haskell らしいスタイルを保て。関数の
複雑さの大部分はレンダリングされるさまざまなオブジェクトに由来し、
各オブジェクトはレンダー関数である。各レンダー可能オブジェクトは
src/render/<name>.ts の自前のファイルに存在しなければならない — そのディレクトリこそ、
レンダー可能オブジェクトを追加するにつれてスケールする場所である。src/render/ の下に
レンダー関数/ファイルを追加するだけでスケールできるようにプロジェクトを構成せよ。
不必要な複雑さを避けよ。

出典

原作者
VictorTaelin
公開日
2026-09-25(由推文 ID 反解)
原典
元の投稿を見る ↗
収録元
yihui-dev/awesome-opus5-5-videos · victortaelin-875778 · MIT
zhuyansen/awesome-opus-5.5-video · 2103299766473875778 · ライセンス未表明
この項目は 2 件の出典を統合・重複排除して作られました