This repository contains three different setups for working with Three.js, demonstrating different levels of complexity and toolchain usage.
A simple setup using Three.js directly from a CDN without any build tools. This is useful for quick prototyping and understanding the core Three.js functionality.
Tech stack: HTML, JavaScript
How to run: Open index.html in a browser
A more advanced setup using Vite for module bundling and including Three.js as a dependency. This setup also introduces OrbitControls for better interaction with the 3D scene.
Tech stack: Vite, Three.js
How to run:
cd vite
npm install
npm run dev
A React-based setup utilizing react-three/fiber for integrating Three.js into a React environment. This project includes a custom RotatingCube component, as well as Sparkles and OrbitControls from @react-three/drei.
Tech stack: Vite, React, React Three Fiber, Drei
How to run:
cd vite+react
npm install
npm run dev
- Basic: Simple Three.js setup with minimal dependencies.
- Vite: Fast development environment with module bundling.
- Vite + React: Component-based architecture with React and enhanced Three.js integration using react-three/fiber and @react-three/drei.
Ensure you have Node.js installed to run the Vite-based projects.