# One-Shot Prompt

**Simulation**: Paper / Receipt
**Theme**: Receipt paper
**Generated**: 2026-04-05

## Prompt

Create an interactive 3D physics simulation of a crumpled receipt floating, being torn, folding, and reacting to mouse/touch interaction. Single HTML file using Three.js r128 from CDN (`https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js`). All physics from scratch — no physics libraries.

**Particle Topology**: 30×50 grid of particles forming a rectangular receipt shape (aspect ratio ~1:1.7). Each particle stores position (current + previous for Verlet), velocity proxy via position delta, mass, and pinned state. Top two corners pinned initially. Total ~1500 particles desktop, ~900 mobile.

**Constraints**: Distance constraints between horizontally and diagonally adjacent particles (structural + shear). Rest lengths derived from initial spacing. Tear threshold at 2.5× rest length — when exceeded, the constraint is permanently removed, creating visible tears. 6 constraint solver iterations per substep.

**Integration**: Verlet integration with position-based dynamics. Fixed timestep of 1/60s with accumulator pattern. 8 substeps per frame. Delta-time capped at 33ms. Gravity at (0, -9.81, 0). Damping factor of 0.997 per substep.

**Interaction**: Mouse/touch grab via Three.js raycasting onto an invisible plane. Grabbed particle follows projected mouse position with slight spring-like lag. On release, momentum transfers naturally. Visual feedback: grabbed particle highlighted, cursor changes.

**Forces**: Gravity always active. Wind togglable with 'W' key — sinusoidal gusts in X/Z with Perlin-like noise variation. Slight random perturbation on idle to create gentle floating effect.

**Rendering**: `THREE.MeshStandardMaterial` with `DoubleSide`, off-white color (#F5F0E8) resembling thermal receipt paper. Faint printed "text" lines rendered as darker horizontal stripes on the texture via canvas texture. Directional light with shadow mapping. Ambient light for fill. Ground plane for shadow reception. Clean dark gradient background (#1a1a2e to #16213e). Antialiased, retina-aware renderer.

**Camera**: Custom orbit controls — left-drag to rotate, scroll to zoom, right-drag to pan. Initial position looking slightly down at the receipt.

**UI**: Title "Tender" top-left, instruction text fading after 3 seconds, FPS counter togglable with 'I', reset with 'R', pause with Space, wind with 'W'. Minimal DOM overlay.

**Mobile**: Touch events mapped to grab. Pinch-to-zoom. Reduced particle grid (~24×40). `touch-action: none` on canvas. Responsive fullscreen canvas.

**Meta**: Inline SVG favicon (receipt icon). OG tags. Title "Tender — Receipt Paper Physics".

## Notes

- Verlet integration chosen for stability with cloth-like structures and natural constraint solving
- Tear mechanics via constraint removal create realistic paper ripping without topology changes to the mesh
- Canvas-generated texture avoids external image dependencies while giving receipt-like appearance
- 8 substeps with 6 iterations provides stiff-enough cloth without over-computation
- Hosting: drop index.html into any static host or open via local HTTP server
