drones / README.md
aaurelions's picture
Update README.md
f73b7e4 verified
metadata
title: Drones
emoji: πŸš€
colorFrom: pink
colorTo: indigo
sdk: static
pinned: false

Definitive 3D Viewer

This project is an advanced, web-based 3D model viewer built with Three.js and styled with Tailwind CSS. It allows users to dynamically load and view various 3D models (.glb files) against a selection of 360-degree panoramic backgrounds. The interface is designed to be clean and intuitive, featuring slide-in panels for model and panorama selection.

Features

  • Dynamic Model Loading: Load 3D models on-demand without reloading the page.
  • Multiple Model Support: Easily switch between a predefined list of 3D models.
  • Panoramic Backgrounds: Change the environment and background with a selection of 360Β° panoramic images.
  • Interactive Controls: Utilizes OrbitControls for intuitive camera manipulation (zoom, pan, rotate).
  • Responsive Design: The viewer and UI adapt to different screen sizes.
  • Glassmorphism UI: Modern user interface with a blurred, semi-transparent "glass" effect.
  • Loading Indicators: A main initializer and a loading overlay provide feedback to the user during asset loading.
  • Optimized Rendering: Leverages powerPreference: "high-performance" for better performance on capable hardware.
  • Clean File Structure: Organizes models and images in a clear and understandable way.

Technologies Used

Project Structure

To run this project, you need to organize your asset files as follows. The viewer expects a specific folder structure to locate the 3D models and panoramic images.

.
β”œβ”€β”€ index.html            # The main HTML file for the viewer
β”œβ”€β”€ glb/                  # Folder for 3D models
β”‚   β”œβ”€β”€ gerbera.glb
β”‚   β”œβ”€β”€ shahed1.glb
β”‚   β”œβ”€β”€ shahed2.glb
β”‚   β”œβ”€β”€ shahed3.glb
β”‚   β”œβ”€β”€ supercam.glb
β”‚   β”œβ”€β”€ zala.glb
β”‚   └── beaver.glb
└── jpg/                  # Folder for panoramic images and their thumbnails
    β”œβ”€β”€ bg1.jpg
    β”œβ”€β”€ bg2.jpg
    |   ...
    └── thumbnails/
        β”œβ”€β”€ bg1.jpg
        β”œβ”€β”€ bg2.jpg
        └── ...

How to Use

  • View the Model: Click and drag on the canvas to rotate the camera around the model. Use the scroll wheel to zoom in and out. Right-click and drag to pan the camera.
  • Switch Models: Click the cube icon on the left edge of the screen to open the "Models" panel. Select a model from the list to load it into the scene.
  • Change Panorama: Click the image icon on the right edge of the screen to open the "Panoramas" panel. Select a thumbnail to change the 360Β° background and environment lighting.
  • Close Panels: Click the 'X' button in a panel or click anywhere on the 3D canvas to close any open panels.