Skip to content

gancim/3dog

Repository files navigation

3Dog

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.

Features

  • 3D animated Shiba Inu model
  • Interactive behaviors (walking, sleeping, jumping, etc.)
  • Pet and play interactions
  • Dynamic mood display
  • Realistic environment with trees and ground

Prerequisites

  • Node.js (version 14.0.0 or higher)
  • A modern web browser with WebGL support

Quick Start

  1. Clone the repository:
git clone <your-repository-url>
cd 3dog
  1. Install dependencies: You can use any of these package managers:
# Using npm
npm install

# Using yarn
yarn

# Using pnpm
pnpm install
  1. Start the development server:
# Using npm
npm run dev

# Using yarn
yarn dev

# Using pnpm
pnpm dev
  1. Open your browser and navigate to http://localhost:3000

Deployment

Option 1: Deploy to GitHub Pages

  1. Update the vite.config.js file:
export default {
  base: '/3dog/',  // Replace with your repository name
}
  1. Build the project:
npm run build
  1. Deploy to GitHub Pages:
npm run deploy

Option 2: Deploy to Netlify

  1. Push your code to GitHub

  2. 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"

Option 3: Deploy to Vercel

  1. Install Vercel CLI:
npm install -g vercel
  1. Deploy:
vercel

Project Structure

3dog/
├── index.html          # Main HTML file
├── main.js            # Main JavaScript file with Three.js setup
├── package.json       # Project dependencies
└── README.md          # This file

Controls

  • ✋ Button: Pet the dog
  • ⚾ Button: Play fetch with the dog

Browser Support

The application requires WebGL support and works best in modern browsers:

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT License - feel free to use this code for your own projects!

Acknowledgments

  • Three.js for the 3D graphics library
  • The Three.js community for examples and inspiration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors