ai21.net
言語

ゼリー状キウイウェッジのソフトボディシミュレーション

ゼリー状キウイウェッジのソフトボディシミュレーション — 1

プロンプト

Build "Kiwi Jelly Wedge" — a single self-contained HTML file (inline JS/CSS, no libraries): a real-time WebGPU soft-body gummy kiwi wedge you can grab, stretch, lift and twist.
Object
One sixth of a thick kiwi slice: a pie-shaped wedge with 30° half-angle, radius ≈ 1.8 and thickness 0.56. Rounded corners (iq's exact pie SDF minus a rounding radius) and bevelled top/bottom edges.
Regions, measured from the tip in rest space:a cream core at the tip with a slightly lobed edge;
thin pale rays fanning out of the core every 2π/56, each with its own random brightness and length;
a darker, glassier ring around the seeds (blushes red in the Ruby variety);
bright juicy outer flesh with radial cell grain and a lighter band just under the skin;
a thin brown fuzzy skin on the arc wall.

Seeds:small flattened black teardrops, pointed end toward the core, in radial rows between the rays, at four depths;
the face layers break the cut surfaces like real seeds; the others float inside and show through the jelly;
wet glossy shading.

A few small air bubbles in the outer flesh.
Varieties: Green, Gold, Ruby.
Physics (XPBD tetrahedral soft body)
Mesh: 2D Delaunay of the rounded outline plus a hex lattice, extruded into prisms → tets.
Co-rotational per-tet shape matching (warm-started quaternion) plus volume constraints.
Stiffer skin and core tets; edge-velocity damping; floor contact with Coulomb friction.
Soft patch grab with bounded reach; scroll or a second finger twists the held patch.
Fixed 60 Hz step with 10 substeps; gentle settling.
Seeds and bubbles are separate meshes embedded in the tets by barycentric weights, so they ride with the flesh.
Rendering (WebGPU / WGSL)
Procedural photo-studio cyclorama with softboxes. Soft PCSS key shadow tinted green, plus contact AO from a top-down height map.
Seeds and bubbles are drawn in the scene pass. A back-face pass gives the view-ray thickness.
Jelly:refraction of the scene, with per-tap Beer–Lambert absorption by material (flesh, glassy seed ring, milky core and rays, opaque skin);
scattering, back-lit glow at thin edges, Fresnel studio reflections and GGX highlights;
a velvet sheen on the fuzzy skin;
sparse sugar glints in the flesh.

Post: exposure, Khronos PBR Neutral tone mapping, sRGB, dither.
UI (editorial "Material Studies / No. 028", English)
Italic serif title "Kiwi / Jelly." with the caption "An emerald wedge. A halo of seeds. A gentle wobble."
Status pill "WEBGPU · LIVE".
Panel "The Specimen": variety chips (skin / core / flesh bands); Firmness ("trembling → set") and Internal damping ("lively → syrupy") sliders; Give it a nudge, Reset, Pause; ¼ speed and Show mesh.
Readouts: Mass (g, 1 unit ≈ 1.6 cm at 1.3 g/cm³), Volume (% of rest), Kinetic (µJ).
A collapsible "Inside the experiment" with notes on the method.
Fallback "This kiwi needs WebGPU." Stacked mobile layout with no horizontal scroll.

日本語訳

「Kiwi Jelly Wedge」を作ってください — 単一の自己完結型 HTML ファイル(インライン JS/CSS、ライブラリなし):掴み、伸ばし、持ち上げ、ねじることができるリアルタイム WebGPU のソフトボディのグミ状キウイウェッジ。
オブジェクト
厚いキウイスライスの6分の1:半角30°、半径≈1.8、厚さ0.56のパイ型ウェッジ。角は丸め(iq の正確なパイ SDF から丸め半径を引いたもの)、上下の縁はベベル処理。
領域は静止空間で先端から測る:先端のクリーム色のコア。縁はわずかに波打つ;
2π/56 ごとにコアから扇状に広がる細く淡い光条。それぞれ固有のランダムな明るさと長さを持つ;
種子の周りの、より暗くよりガラス質なリング(Ruby 品種では赤く色づく);
放射状の細胞のきめがあり、皮のすぐ下に明るい帯を持つ、明るくジューシーな外側の果肉;
弧状の壁面を覆う、薄い茶色で毛羽立った皮。

種子:小さく扁平な黒い雫形で、尖った端をコアに向け、光条の間の放射状の列に4つの深さで配置;
表面の層は本物の種のように切断面を断ち切り、それ以外は内部に浮かんでゼリー越しに見える;
濡れた光沢のシェーディング。

外側の果肉に小さな気泡がいくつか。
品種:Green、Gold、Ruby。
物理演算(XPBD 四面体ソフトボディ)
メッシュ:丸めた輪郭の2D Delaunay とヘックス格子をプリズムに押し出して → 四面体。
四面体ごとの共回転形状マッチング(ウォームスタートのクォータニオン)と体積拘束。
皮とコアの四面体はより硬く;エッジ速度の減衰;クーロン摩擦を伴う床との接触。
到達範囲を制限したソフトパッチのグラブ;スクロールまたは2本目の指で、掴んだパッチをひねる。
10サブステップの固定60 Hzステップ;穏やかな安定化。
種子と気泡は重心座標の重みで四面体に埋め込まれた別個のメッシュなので、果肉と一緒に動きます。
レンダリング(WebGPU / WGSL)
ソフトボックス付きのプロシージャルなフォトスタジオ用サイクロラマ。緑に色づいたソフトな PCSS キーシャドウ、さらにトップダウンのハイトマップからのコンタクト AO。
種子と気泡はシーンパスで描画します。裏面パスが視線方向の厚みを与えます。
ゼリー:シーンの屈折。タップごとに材質(果肉、ガラス質の種子リング、乳白色のコアと光条、不透明な皮)による Beer–Lambert 吸収;
散乱、薄い縁の逆光の輝き、フレネルのスタジオ反射と GGX ハイライト;
毛羽立った皮のベルベットのような光沢;
果肉の中のまばらな砂糖のきらめき。

ポスト:露出、Khronos PBR Neutral トーンマッピング、sRGB、ディザ。
UI(エディトリアル調の「Material Studies / No. 028」、英語)
イタリックのセリフ体タイトル「Kiwi / Jelly.」とキャプション「An emerald wedge. A halo of seeds. A gentle wobble.」
ステータスピル「WEBGPU · LIVE」。
パネル「The Specimen」:品種チップ(skin / core / flesh の帯);Firmness(「trembling → set」)と Internal damping(「lively → syrupy」)のスライダー;Give it a nudge、Reset、Pause;¼ 速度と Show mesh。
リードアウト:Mass(g、1単位 ≈ 1.6 cm、1.3 g/cm³ の場合)、Volume(静止時の %)、Kinetic(µJ)。
手法についての注記を含む、折りたたみ可能な「Inside the experiment」。
フォールバックは「This kiwi needs WebGPU.」。横スクロールのないスタック型のモバイルレイアウト。

出典

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