Back to Blog

Hamburger

December 2023
Harshit Raj
3DThree.jsWebGLInteractiveVisualizationJavaScriptFrontend
Hamburger

3D Hamburger

3D Hamburger Three.js Vite

An interactive 3D hamburger viewer built with Three.js and Vite. This project displays a 3D hamburger model that rotates dynamically as you move your mouse across the screen, along with a custom animated cursor.

Features

  • 3D hamburger model visualization using Three.js
  • Interactive model rotation that follows mouse movement
  • Custom animated cursor with hover effects
  • Responsive design that works across different screen sizes
  • Built with Vite for fast development and optimized production builds

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn

Installation

  1. Clone this repository:

    cd hamburger
    
  2. Install the dependencies:

    npm install
    # or
    yarn
    
  3. Start the development server:

    npm run dev
    # or
    yarn dev
    
  4. Open your browser and navigate to http://localhost:5173

Building for Production

To create a production-ready build:

npm run build
# or
yarn build

The build files will be in the dist directory.

Project Structure

├── public/             # Static assets
│   ├── scene.glb       # 3D model (glb format)
│   ├── scene.gltf      # 3D model (gltf format)
│   └── vite.svg        # Vite logo
├── index.html          # Main HTML file
├── main.js             # Main JavaScript entry point
├── counter.js          # Counter component
├── style.css           # CSS styles
├── package.json        # Project dependencies
└── README.md           # This file

Technology Stack

Controls

  • Mouse movement: Rotates the hamburger model
  • Cursor: Features custom animation on hover and click

Credits

  • 3D Hamburger Model: "Cute Hamburger - Free 3D Model"

License

Check the license information in the included cute_hamburger_-_free_3d_model/license.txt file for details about the 3D model usage rights.

Author

Your Name


Made with ❤️ and JavaScript

Share this article

More articles