ai21.net
言語

インタラクティブなゼリー圧搾玩具

インタラクティブなゼリー圧搾玩具 — 1

プロンプト

Create "Jelly Press": a single-file interactive 3D toy in HTML (all JS, CSS and WGSL shaders inline, no external assets except Google Fonts). Render with WebGPU; if WebGPU or an adapter is missing, show a clean fallback message instead of a blank page.

CONCEPT
Four translucent gummy jellies shaped like fruit slices sit one at a time on the steel bed of a hydraulic press. The player holds a big red button to lower the press. The jelly squashes and spreads, the pressure gauge climbs, and somewhere past half its height it bursts into pieces. After the burst the game does NOT end: the player can grab the pieces, drag them, throw them around, and squash them again.

THE JELLIES (chips at the bottom, keys 1–4)
1. Watermelon wedge (half-disc slab): red flesh with dark teardrop seeds, a pale rind band, a green striped skin.
2. Orange slice (half-disc): orange pulp segments separated by thin white membranes, pale pith, orange peel.
3. Fig half: pink flesh full of small golden seeds, a cream layer, a dark purple skin.
4. Pineapple ring: golden fibrous flesh with radial streaks and a hole in the middle.
Each jelly should look like real gummy candy: subsurface scattering, soft translucency, glossy specular highlights, soft shadows on a warm studio floor (cream/beige, tone-mapped).

PHYSICS (CPU, fixed 60 Hz step)
- XPBD tetrahedral soft body with 8 substeps: co-rotational per-tet shape matching, per-tet volume constraints, hard edge strain limits (0.35×–1.8×), edge velocity damping, floor contact with Coulomb friction, rolling resistance, and gentle settling when nearly still.
- Render mesh skinned on the CPU through barycentric embedding in the tets; normals recomputed from triangles every frame.
- The press die is a kinematic round platen (radius ~1.05, rounded edge, a thickness, a ram above it). It acts as a ceiling with friction below, a shelf on top, and a side wall at its rim. The two press posts are solid.
- Pressure readout in bar comes from the platen's contact load, scaled per fruit.

THE BURST
- Break at a random squash between 52% and 66% of the jelly's height.
- Plan the fracture in the background shortly after each round starts, so the burst itself is instant.
- 5–7 big pieces from 3D Voronoi cells with slightly tilted walls. On 3–4 of them, a far corner is chipped off by two cutting planes and split further into 2–4 small chips, which leaves jagged, notched edges.
- Assign tets to cells by centroid. Duplicate particles per chunk. Merge tiny islands into their neighbours.
- The new body adopts the old positions and velocities.
- Clip the skin triangles against each cell's half-spaces, and fill every cut face with a clean flat cap showing the fruit's interior (flesh, seeds, membranes). No stretched triangles, no holes.
- Kick pieces outward and upward from the press. Small chips fly faster and higher and tumble with random spin.
- Show a big italic verdict for about 2.5 s, then fade it: "Splat." (melon), "Squeezed." (orange), "Well, that's jam." (fig), "Crushed." (pineapple). Include a stat line: "Gave up at N bar and N% of its height."

AFTER THE BURST: PLAY MODE
- Picking: ray/triangle test against the skinned mesh, with a forgiving screen-space fallback for touch.
- Grabbing pins the grabbed patch (radius ~0.4, only particles of that chunk) to a target on a camera-facing drag plane. Small chips move whole; big pieces stretch and swing like jelly.
- Releasing throws the piece with the pointer's velocity.
- Pieces collide with each other. A particle found inside another chunk's tet is pushed out through that chunk's nearest skin face, with friction. Use a chunk AABB broad phase and a spatial hash of skin tets.
- Pieces stay on stage: side walls, plus an invisible front edge so nothing ends up under the controls or behind the camera.
- The press still works: hold to squash the pieces again (no second fracture); Raise lifts the platen.
- Wet "plop" sounds on landings; a small squelch on grab.
- Cursor: open hand over pieces, closed hand while dragging. Dragging empty space orbits the camera.

UI (editorial, minimal)
- Masthead top-left: "JELLY PRESS" in bold condensed caps, with "PRESS" filled in yellow/black hazard stripes. Subtitle: "Four gummies. One hydraulic press."
- Top-right: Reset and Sound toggle.
- Bottom deck:
- Caption line with escalating captions while pressing: "Contact." → "It's fine. It's jelly." → "Getting wider." → "That's a pancake now." → "It's making a noise." → "Please."
- Circular pressure dial (0–400 bar arc, red zone) around a red HOLD button, a Raise button, and a big numeric bar readout.
- Fruit chips with icons.
- In play mode the caption slot shows "Grab a piece. Throw it." with small "Press again" and "Next jelly" buttons.
- Controls: hold Space or ArrowDown to press, ArrowUp to raise, R to reset, 1–4 to pick a fruit. Wheel zooms; double-click resets the view.
- Camera: low bench-level view; the press frame yaws per fruit so the posts never block the jelly. Framing adapts so the jelly sits between masthead and deck; works on phones (portrait) with a narrower stage.

SOUND (procedural Web Audio, no files)
Hydraulic motor hum that rises with pressure, wet squelches, occasional creaks at high pressure, a valve clunk when the platen stops, a loud burst, soft plops on landing. Unlock on first interaction.

QUALITY BAR
- Smooth 60 fps on a laptop.
- Background warm-up of the other fruits' meshes and shaders so switching is instant.
- Respect prefers-reduced-motion.
- Accessible labels, a gauge with role=meter, focus-visible outlines.
- No console errors. The page never goes blank.

日本語訳

「Jelly Press」を作成してください:HTML の単一ファイルで動くインタラクティブな 3D 玩具で、JS、CSS、WGSL シェーダーはすべてインライン、Google Fonts 以外の外部アセットは使いません。WebGPU でレンダリングし、WebGPU またはアダプターが見つからない場合は、空白のページではなく整ったフォールバックメッセージを表示してください。

コンセプト
フルーツのスライス形をした半透明のグミゼリーが 4 つ、油圧プレスの鋼鉄のベッドに 1 つずつ載ります。プレイヤーは大きな赤いボタンを押し続けてプレスを下げます。ゼリーはつぶれて広がり、圧力計の針が上がり、高さの半分を超えたあたりで粉々に破裂します。破裂後もゲームは終わりません:プレイヤーは破片をつかみ、ドラッグし、投げ回し、もう一度つぶすことができます。

ゼリーたち(下部のチップ、キー 1〜4)
1. スイカのくさび形(半円盤のスラブ):赤い果肉に濃い色の涙滴形の種、淡い色の皮の帯、緑の縞模様の外皮。
2. オレンジのスライス(半円盤):薄い白い膜で仕切られたオレンジ色の果肉の房、淡い白皮、オレンジの皮。
3. イチジクの半分:小さな金色の種でいっぱいのピンクの果肉、クリーム色の層、濃い紫の外皮。
4. パイナップルのリング:放射状の筋が入った金色の繊維質の果肉、中央に穴。
各ゼリーは本物のグミキャンディのように見えるべきです:サブサーフェススキャタリング、柔らかな半透明感、光沢のある鏡面ハイライト、暖かなスタジオの床(クリーム/ベージュ、トーンマップ済み)に落ちる柔らかな影。

物理(CPU、固定 60 Hz ステップ)
- 8 サブステップの XPBD 四面体ソフトボディ:テトラごとのコーポテーショナル形状マッチング、テトラごとの体積拘束、ハードなエッジひずみ限界(0.35×〜1.8×)、エッジ速度ダンピング、クーロン摩擦を伴う床接触、転がり抵抗、ほぼ静止したときの穏やかな収束。
- レンダーメッシュはテトラへの重心座標埋め込みにより CPU 上でスキニングし、法線は毎フレーム三角形から再計算します。
- プレス金型はキネマティックな円形プラテンです(半径約 1.05、丸みのあるエッジ、厚み、その上にラム)。下面は摩擦を伴う天井、上面は棚、縁は側壁として機能します。2 本のプレスポストはソリッドです。
- bar 単位の圧力表示は、プラテンの接触荷重から算出し、フルーツごとにスケールします。

破裂
- ゼリーの高さの 52% から 66% の間のランダムなつぶれ量で破断します。
- 各ラウンド開始直後にバックグラウンドで破壊を計画し、破裂自体は瞬時に起きるようにします。
- わずかに傾いた壁を持つ 3D ボロノイセルから、5〜7 個の大きな破片を作ります。そのうち 3〜4 個では、遠い側の角を 2 つの切断平面で欠き取り、さらに 2〜4 個の小さなチップに分割して、ギザギザの切り欠きエッジを残します。
- テトラは重心によってセルに割り当てます。チャンクごとにパーティクルを複製します。小さな島は隣の島にマージします。
- 新しいボディは元の位置と速度を引き継ぎます。
- スキンの三角形を各セルの半空間でクリップし、すべての切断面を、フルーツの内部(果肉、種、膜)が見えるきれいな平らなキャップで埋めます。引き伸ばされた三角形や穴はなし。
- 破片はプレスから外側かつ上方へ蹴り出します。小さなチップはより速く高く飛び、ランダムなスピンで回転します。
- 大きなイタリック体の判定を約 2.5 秒表示してからフェードアウトします:"Splat."(メロン)、"Squeezed."(オレンジ)、"Well, that's jam."(イチジク)、"Crushed."(パイナップル)。統計行を含めます:"Gave up at N bar and N% of its height."

破裂後:プレイモード
- ピッキング:スキニングされたメッシュに対するレイ/三角形テスト。タッチ用に寛容なスクリーン空間フォールバック付き。
- グラブすると、つかんだパッチ(半径約 0.4、そのチャンクのパーティクルのみ)を、カメラに正対するドラッグ平面上のターゲットに固定します。小さなチップは全体が移動し、大きな破片はゼリーのように伸びて揺れます。
- リリースすると、ポインタの速度で破片を投げます。
- 破片同士は衝突します。別のチャンクのテトラの内部にあるパーティクルは、そのチャンクの最も近いスキン面から摩擦を伴って押し出されます。チャンクの AABB によるブロードフェーズと、スキン四面体の空間ハッシュを使います。
- 破片はステージ上に留まります:側壁に加え、コントロールの下やカメラの背後に何も行かないよう見えない前縁があります。
- プレスは引き続き機能します:押し続けると破片をもう一度つぶせます(2 回目の破断はなし)。Raise でプラテンが上がります。
- 着地時には湿った "plop" 音、グラブ時には小さな squelch 音。
- カーソル:破片の上では開いた手、ドラッグ中は閉じた手。何もない空間をドラッグするとカメラが周回します。

UI(エディトリアル、ミニマル)
- マストヘッドは左上:"JELLY PRESS" を太字のコンデンス体大文字で、"PRESS" は黄/黒のハザードストライプで塗ります。サブタイトル:"Four gummies. One hydraulic press."
- 右上:Reset と Sound のトグル。
- 下部デッキ:
- 押している間、段階的にエスカレートするキャプション行:"Contact." → "It's fine. It's jelly." → "Getting wider." → "That's a pancake now." → "It's making a noise." → "Please."
- 赤い HOLD ボタンの周囲に円形の圧力ダイヤル(0〜400 bar の弧、レッドゾーン)、Raise ボタン、大きな数値の bar 表示。
- アイコン付きのフルーツチップ。
- プレイモードではキャプションスロットに "Grab a piece. Throw it." を表示し、小さな "Press again" と "Next jelly" ボタンを添えます。
- 操作:Space または ArrowDown を押し続けるとプレス、ArrowUp で上昇、R でリセット、1〜4 でフルーツを選択。ホイールでズーム、ダブルクリックでビューをリセット。
- カメラ:低いベンチレベルの視点。プレスフレームはフルーツごとにヨーし、ポストがゼリーを遮らないようにします。フレーミングはゼリーがマストヘッドとデッキの間に収まるよう適応し、狭いステージでもスマートフォン(縦向き)で動作します。

サウンド(プロシージャル Web Audio、ファイルなし)
圧力とともに高まる油圧モーターの唸り、湿った squelch 音、高圧時の時折の軋み、プラテンが止まったときのバルブの clunk 音、大きな破裂音、着地時の柔らかな plop 音。最初のインタラクションでアンロックします。

品質基準
- ラップトップで滑らかな 60 fps。
- 切り替えが瞬時になるよう、他のフルーツのメッシュとシェーダーをバックグラウンドでウォームアップ。
- prefers-reduced-motion を尊重。
- アクセシブルなラベル、role=meter を持つゲージ、focus-visible のアウトライン。
- コンソールエラーなし。ページが空白になることはありません。

出典

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