4x4 Builder is a browser-based 3D off-road vehicle customization and simulation app. Build your dream 4x4, customize every detail from suspension lift to tire size, then drive it through procedurally generated terrain with realistic physics. Features multiplayer support, VR compatibility, and real-time engine audio synthesis.
๐ Try it live at 4x4builder.com
- Vehicles โ Toyota 4Runner (3rdโ5th gen), Land Cruiser (J80, J250), Tacoma, Jeep Wrangler (YJ, JK), Cherokee XJ, Ford Bronco
- Suspension โ Adjustable lift height from stock to 6"
- Wheels โ Various rim options from brands like XD Wheels, American Racing, Konig, Cragar, and OEM
- Tires โ Multiple tire models including BFGoodrich KM2/KM3/AT, Nitto Mud Grappler, Maxxis Trepador
- Customizable sizing โ Rim diameter (15"โ22"), tire diameter (28"โ40"), rim width, wheel offset
- Paint & Finish โ Any body color with adjustable metallic/matte finish
- Accessories โ Bumpers, rock sliders, roof racks (vehicle-specific)
- Realistic physics โ Powered by Rapier physics engine with suspension, torque curves, and transmission simulation
- Procedural terrain โ Infinite, dynamically generated terrain with varied elevation and flat regions
- Dynamic grass โ GPU-instanced grass with wind animation that responds to terrain
- Engine audio โ Real-time synthesized engine sounds using Web Audio API AudioWorklet
- Tire tracks โ Persistent tire marks in the terrain
- Dust particles โ Wheel dust effects when driving
- Orbit camera โ Third-person view with smooth follow and terrain collision avoidance
- First-person โ Driver's seat perspective
- Auto-rotate โ Showcase mode for screenshots
- Real-time multiplayer โ See other players' vehicles and drive together
- Room-based โ Create or join rooms to play with friends
- In-game chat โ Communicate with other players
- Vehicle sync โ Your customizations are visible to others
- WebXR compatible โ Works with VR headsets via
@react-three/xr - Teleport locomotion โ Navigate with VR controllers
- Immersive experience โ Sit inside your custom vehicle in VR
- Screenshot export โ Download high-quality PNG images
- URL sharing โ Vehicle configuration URLs for easy sharing
- Local storage โ Save multiple vehicle builds
- Mobile support โ Touch controls with virtual joysticks
- Responsive UI โ Works on desktop, tablet, and mobile
| Category | Technologies |
|---|---|
| Frontend | React 19, Zustand, Tailwind CSS 4 |
| 3D Engine | Three.js, React Three Fiber, Drei |
| Physics | Rapier via @react-three/rapier |
| VR/XR | @react-three/xr |
| Audio | Web Audio API with custom AudioWorklet |
| Build Tool | Vite |
| Multiplayer Server | Node.js with ws WebSocket library |
| Shaders | Custom GLSL for terrain, grass, and sky |
- Node.js 20.0.0 or higher
- npm or yarn
# Clone the repository
git clone https://github.com/theshanergy/4x4builder.git
cd 4x4builder
# Install dependencies
npm install
# Start the development server
npm run devOpen https://localhost:5173 in your browser.
Note: The dev server uses HTTPS with a self-signed certificate for WebXR compatibility. You may need to accept the security warning in your browser.
npm run build
npm run previewThe multiplayer server is a separate Node.js application located in the server/ directory.
# Navigate to server directory
cd server
# Install server dependencies
npm install
# Start the server (development with auto-reload)
npm run dev
# Or start for production
npm startThe server runs on port 8080 by default and provides:
- WebSocket connections for real-time multiplayer
- Health check endpoint:
http://localhost:8080/health - Stats endpoint:
http://localhost:8080/stats
| Variable | Description | Default |
|---|---|---|
VITE_MULTIPLAYER_SERVER_URL |
WebSocket server URL for multiplayer | ws://localhost:8080 |
4x4builder/
โโโ components/
โ โโโ scene/ # 3D scene components (Vehicle, Terrain, Camera, etc.)
โ โโโ ui/ # React UI components (Editor, Sidebar, Chat, etc.)
โโโ hooks/ # Custom React hooks (physics, audio, materials)
โโโ network/ # Multiplayer networking (WebSocket client)
โโโ public/assets/ # Static assets (3D models, textures, audio)
โ โโโ models/
โ โโโ vehicles/ # Vehicle GLB models by make/model
โ โโโ wheels/ # Rim and tire GLB models
โโโ server/ # Multiplayer WebSocket server
โโโ shaders/ # GLSL vertex and fragment shaders
โโโ store/ # Zustand state stores
โโโ utils/ # Utility functions
โโโ vehicleConfigs.js # Vehicle, wheel, and tire definitions
| Key | Action |
|---|---|
โ / W |
Accelerate |
โ / S |
Brake / Reverse |
โ / โ or A / D |
Steer |
Shift |
Drift mode |
R |
Reset vehicle position |
C |
Cycle camera mode |
T |
Open chat (multiplayer) |
Esc |
Close chat / menus |
- Left joystick โ Steering
- Right joystick โ Throttle/brake
- Drift button โ Enable drift mode
- Reset button โ Reset vehicle position
Full controller support with analog steering and triggers.
Contributions are welcome! Here are some ways you can help:
- ๐ Report bugs โ Open an issue with details and reproduction steps
- ๐ก Request features โ Suggest new vehicles, parts, or functionality
- ๐ง Submit PRs โ Fix bugs or implement new features
- ๐จ Create 3D models โ Contribute new vehicles, wheels, or accessories
- ๐ Improve docs โ Help make the documentation clearer
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes and test thoroughly
- Submit a pull request with a clear description
- React โ UI framework
- Three.js โ 3D graphics library
- React Three Fiber โ React renderer for Three.js
- Drei โ Useful helpers for R3F
- Rapier โ Physics engine
- Zustand โ State management
- Vite โ Build tool
- Tailwind CSS โ Styling
