A fun interactive 3D dog simulation built with Three.js. The dog performs various behaviors and responds to user interactions like petting and playing fetch.
- 3D animated Shiba Inu model
- Interactive behaviors (walking, sleeping, jumping, etc.)
- Pet and play interactions
- Dynamic mood display
- Realistic environment with trees and ground
- Node.js (version 14.0.0 or higher)
- A modern web browser with WebGL support
- Clone the repository:
git clone <your-repository-url>
cd 3dog- Install dependencies: You can use any of these package managers:
# Using npm
npm install
# Using yarn
yarn
# Using pnpm
pnpm install- Start the development server:
# Using npm
npm run dev
# Using yarn
yarn dev
# Using pnpm
pnpm dev- Open your browser and navigate to
http://localhost:3000
- Update the
vite.config.jsfile:
export default {
base: '/3dog/', // Replace with your repository name
}- Build the project:
npm run build- Deploy to GitHub Pages:
npm run deploy-
Push your code to GitHub
-
Connect your GitHub repository to Netlify:
- Sign in to Netlify
- Click "New site from Git"
- Choose your repository
- Build command:
npm run build - Publish directory:
dist - Click "Deploy site"
- Install Vercel CLI:
npm install -g vercel- Deploy:
vercel3dog/
├── index.html # Main HTML file
├── main.js # Main JavaScript file with Three.js setup
├── package.json # Project dependencies
└── README.md # This file
- ✋ Button: Pet the dog
- ⚾ Button: Play fetch with the dog
The application requires WebGL support and works best in modern browsers:
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
MIT License - feel free to use this code for your own projects!
- Three.js for the 3D graphics library
- The Three.js community for examples and inspiration