Skip to content

An interactive 3D glasses viewer built with Three.js featuring customizable Ray-Ban models. Experience realistic 3D rendering with real-time color customization and smooth controls.

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license.txt
Notifications You must be signed in to change notification settings

DevAmirHub/3dglass_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ•ถ๏ธ 3D Glasses Viewer

An interactive 3D glasses viewer built with Three.js featuring customizable Ray-Ban models. Experience realistic 3D rendering with real-time color customization and smooth controls.

3D Glasses Viewer License Version

โœจ Features

  • ๐ŸŽจ Real-time Color Customization - Change frame, lens, and bridge colors instantly
  • ๐Ÿ–ฑ๏ธ Interactive Controls - Smooth mouse and touch controls for 360ยฐ viewing
  • ๐Ÿ“ฑ Responsive Design - Works perfectly on desktop, tablet, and mobile devices
  • โšก High Performance - Optimized rendering with WebGL and modern Three.js features
  • ๐ŸŽฏ Auto-rotation - Optional automatic model rotation with adjustable speed
  • ๐ŸŒ™ Modern UI - Clean, dark theme with gradient accents and smooth animations
  • โ™ฟ Accessibility - Screen reader support and keyboard navigation
  • ๐Ÿ”ง Developer Friendly - Well-documented code with modern ES6+ features

๐Ÿš€ Quick Start

Prerequisites

  • Node.js (v16 or higher)
  • Modern web browser with WebGL support

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/3d-glasses-viewer.git
    cd 3d-glasses-viewer
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev
  4. Open your browser Navigate to http://localhost:5173 to view the application

Build for Production

# Build the project
npm run build

# Preview the production build
npm run preview

๐ŸŽฎ Controls

Action Description
Mouse Drag Rotate the 3D model
Mouse Wheel Zoom in/out
GUI Panel Customize colors and settings
Auto Rotate Toggle automatic rotation

๐Ÿ› ๏ธ Development

Project Structure

3d-glasses-viewer/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ 3dGlass.js      # Main Three.js application
โ”‚   โ”œโ”€โ”€ index.html      # HTML structure
โ”‚   โ””โ”€โ”€ style.css       # Modern CSS styling
โ”œโ”€โ”€ static/
โ”‚   โ”œโ”€โ”€ draco/          # Draco compression files
โ”‚   โ””โ”€โ”€ models/         # 3D model assets
โ”œโ”€โ”€ package.json        # Dependencies and scripts
โ”œโ”€โ”€ vite.config.js      # Vite configuration
โ””โ”€โ”€ README.md          # This file

Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run preview  # Preview production build
npm run lint     # Run ESLint
npm run format   # Format code with Prettier

Key Technologies

  • Three.js - 3D graphics library
  • Vite - Fast build tool and dev server
  • lil-gui - Lightweight GUI controls
  • DRACO - 3D geometry compression
  • WebGL - Hardware-accelerated graphics

๐ŸŽจ Customization

Adding New Models

  1. Place your .gltf or .glb file in static/models/
  2. Update the modelPath in src/3dGlass.js
  3. Adjust material indices if needed

Styling

The application uses CSS custom properties for easy theming:

:root {
  --primary-color: #2563eb;
  --background-color: #0f172a;
  --surface-color: #1e293b;
  /* ... more variables */
}

Performance Optimization

  • Pixel Ratio: Automatically capped at 2x for performance
  • Shadow Maps: Enabled with soft shadows
  • Tone Mapping: ACES Filmic for realistic lighting
  • Lazy Loading: Models load asynchronously with progress indicators

๐Ÿ“ฑ Browser Support

  • โœ… Chrome 80+
  • โœ… Firefox 75+
  • โœ… Safari 13+
  • โœ… Edge 80+
  • โœ… Mobile browsers with WebGL support

๐Ÿค Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Use modern ES6+ JavaScript features
  • Follow the existing code style
  • Add comments for complex logic
  • Test on multiple browsers
  • Ensure responsive design

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Three.js community for the amazing 3D library
  • Ray-Ban for the inspiration (this is a fan project)
  • Vite team for the excellent build tool
  • lil-gui for the lightweight controls

๐Ÿ“ž Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue with detailed information
  3. Contact the maintainer

๐Ÿ”ฎ Future Features

  • Multiple glasses models
  • AR/VR support
  • Export functionality
  • Advanced lighting controls
  • Material presets
  • Social sharing

Made with โค๏ธ by Dev Amir

Experience the future of 3D web applications

About

An interactive 3D glasses viewer built with Three.js featuring customizable Ray-Ban models. Experience realistic 3D rendering with real-time color customization and smooth controls.

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published