Giter Site home page Giter Site logo

garden's Introduction

๐ŸŒฑ Garden

Deploy with Vercel Deploy to Netlify

This project demonstrates how to display different 3D GLB models based on the user's geolocation, using the browser GeoLocation API and model-viewer.js. When the user is within a specified range of the desired location, the corresponding 3D model will load and display. The models can be viewed in both the 3D viewer and the AR mode.

Features

  • Load and display different 3D GLB models based on the user's geolocation
  • Set custom scale for each 3D model
  • View models in both the 3D viewer and the AR mode
  • Show an alert when the user is not close enough to any of the desired locations to load the 3D models

Development

  1. Clone or download this repository git clone https://github.com/et0and/garden.git
  2. Open the index.html file in a modern web browser that supports WebGL and AR features (e.g., Mozilla Firefox, Google Chrome).
  3. Grant the browser permission to access your location.
  4. If your location is within the specified range of a desired location, the corresponding 3D model will load and display. Otherwise, an alert will inform you that you are not close enough to any of the desired locations to load the 3D models.

Customization

To add more models or modify the existing ones, open the index.html file and update the models array with the desired model files, latitudes, longitudes, and scales.

For example:

const models = [
    {
        src: 'model-one.glb',
        latitude: 12.9715987,
        longitude: 77.5945627,
        scale: '2 2 2'
    },
    {
        src: 'model-two.glb',
        latitude: 12.9655987,
        longitude: 77.5895627,
        scale: '1.5 1.5 1.5'
    }
];

This project is released under the MIT License. See the LICENSE file for more information.

garden's People

Contributors

et0and avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.