This is a starter template for building Three.js applications from scratch, created by me. It uses Vite for fast development, npm for package management, and is designed to work seamlessly with modern browsers like Chrome.
- Vite: Super-fast build tool optimized for modern web development.
- Three.js: 3D graphics library for creating interactive 3D content in the browser.
- OrbitControls: Easy navigation and camera controls in 3D scenes.
- Chrome Optimized: Works best with modern browsers like Chrome.
Ensure you have Node.js installed. You can check this by running:
node -v
npm -v
If not installed, download from Node.js Official Website.
-
Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
-
Navigate to the project directory:
cd your-repo-name
-
Install dependencies:
npm install
To start the development server:
npm run dev
The application will be available at: http://localhost:5173/
To create an optimized production build:
npm run build
- src/index.js: The entry point for your Three.js application.
- src/App.js: Contains the initialization logic for Three.js, the scene, and the renderer.
- src/World.js: Handles the setup for objects (like meshes), the camera, and controls.
This template is optimized for Chrome, but it should work in any modern browser that supports WebGL.
You can add custom objects, lights, or other Three.js features by editing the World.js or adding new modules as needed.
Thank you, kindly share if you find it helpful.