Interactive 3D text rendered as a fuzzy particle cloud using React, Vite, and Three.js.
This app renders editable text into a 3D particle-based cloud effect:
- You type into a hidden
contenteditableelement. - The text is rasterized to an offscreen canvas.
- Pixel coordinates are sampled and converted into particle instances.
- A Three.js scene displays and animates those instances in real time.
The app is a frontend-only SPA (no backend API).
React 18+react-router-domVite 3(dev/build tooling)Three.js+postprocessingstyled-componentszustand(shared viewer state)- ESLint + Prettier
- Node.js 18+ recommended
- Yarn (project uses a
yarn.lock)
yarn installyarn startVite is configured to run on:
http://localhost:4000- host exposed via
--host(accessible on local network)
yarn buildOutput is generated in dist/.
yarn start- start Vite development serveryarn build- create production buildyarn lint- run ESLint with auto-fixyarn format- format JS/JSX/JSON/Markdown with Prettier
src/
components/
ThreeViewer/
ThreeViewer.jsx # React wrapper around ThreeEngine
libs/
ThreeEngine.js # Scene/camera/renderer/loaders/composer
CloudText.js # Text sampling -> instanced particles
pages/
Main/
Main.jsx # Main page hosting the viewer
state/
store.js # Zustand viewer/light/environment state
dataset/
routes.js # SPA routes
environments.js # HDR environment presets
public/
draco/ # Draco decoder files (required for GLTF Draco)
ThreeViewercreates aThreeEngineinstance and hidden text input (#input_3d_text).CloudTextreads input HTML, normalizes line breaks, and computes caret position.- Text is drawn onto an internal canvas using the configured font settings.
- Non-empty pixels are mapped into world-space coordinates.
- A
THREE.InstancedMeshis rebuilt/updated with particle transforms. - Each frame updates particle growth, cursor blink, and renderer/composer output.
Edit constants near the top of src/components/ThreeViewer/libs/CloudText.js:
FONT_NAMEFONT_SIZEFONT_SCALE_FACTOR- initial
this.string
- Environment presets:
src/dataset/environments.js - Store defaults for sun/ambient/exposure:
src/state/store.js
Main rendering/loader/camera logic lives in:
src/components/ThreeViewer/libs/ThreeEngine.js
No runtime environment variables are currently required by app code (import.meta.env / process.env not used in src/).
- Deploy
dist/as a static site. - Keep
public/dracoavailable at/draco/in production (used byDRACOLoader). - Cloud particle alpha texture is loaded from an external URL in
CloudText; if offline/self-hosted deployment is needed, vendor that texture locally.
- In
CloudText.updateCursorOpacity(),clock.getElapsedTime()is referenced instead ofthis.clock.getElapsedTime(). This can cause a runtime error when cursor opacity updates. public/manifest.jsonappears to contain unrelated branding text and may need updating if this project is published as-is.
There is currently no test runner configured (test script is not defined). Linting and formatting are the primary code quality checks in this repository.
