A React + TypeScript + Vite application that generates dynamic 3D wireframe mesh visualizations. This project creates animated that serve as an engaging background for our company website.
This application renders interactive 3D plane-mesh wireframe structures with cloud-like formations, providing a modern and visually appealing background element. The mesh is built using Three.js and features:
- Dynamic wireframe plane-mesh geometry
- Real-time animation and interaction
- Responsive design for various screen sizes
- Performance-optimized rendering
You can import this package directly from Git without publishing to npm. The library is built and distributed from the build branch:
npm install git+https://github.com/Ivy-Interactive/toroid-wireframe-clouds.git#buildOr add to your package.json:
{
"dependencies": {
"toroid-wireframe-clouds": "git+https://github.com/Ivy-Interactive/toroid-wireframe-clouds.git#build"
}
}import { MainScene } from 'toroid-wireframe-clouds';
function App() {
return <MainScene />;
}import { ThreeScene, type SceneParameters } from 'toroid-wireframe-clouds';
function MyScene() {
const parameters: SceneParameters = {
gridWidth: 10,
gridHeight: 10,
arcReach: 0.5,
twistX: 45,
twistY: 30,
twistZ: 15,
twistNoise: 0.2,
cameraPositionX: 0,
cameraPositionY: 0,
cameraPositionZ: 10,
cameraTargetX: 0,
cameraTargetY: 0,
cameraTargetZ: 0,
};
return (
<ThreeScene
parameters={parameters}
onCameraStateChange={(cameraState) => console.log('Camera:', cameraState)}
/>
);
}import { createScene, type SceneSetup } from 'toroid-wireframe-clouds';
const container = document.getElementById('scene-container');
const sceneSetup: SceneSetup = createScene(container);
// Start animation loop
function animate() {
sceneSetup.animate();
requestAnimationFrame(animate);
}
animate();
// Cleanup when done
sceneSetup.cleanup();- Components:
MainScene,ThreeScene,SceneForm,StatsOverlay,DrawCallsOverlay - Functions:
createScene - Types:
SceneParameters,CameraState,SceneSetup
- Node.js (version 20 or higher)
- npm package manager
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:5173
npm run buildnpm run build:libThe built files will be in the dist directory.
The library is automatically built and deployed to the build branch via GitHub Actions when you push to main. You can also manually trigger the build:
npm run deployThis will:
- Build the library
- Switch to the
buildbranch - Copy the built files to the root
- Update package.json for distribution
- Commit and push to the
buildbranch
src/
├── components/ # React components
│ ├── draw-calls-overlay/ # Performance monitoring
│ ├── scene-form/ # Scene configuration controls
│ ├── stats-overlay/ # Performance statistics
│ └── three-scene/ # Main 3D scene component
├── layouts/ # Layout components
│ └── main-scene/ # Main scene layout
└── App.tsx # Root application component