Giter Site home page Giter Site logo

gltf-viewer's Introduction

<gltf-viewer>

BrowserStack Status

Displays a 3D representation of a glTF model, interactive or static.

Tested with BrowserStack

Live demo

  <gltf-viewer src="demo/duck.gltf" interactive></gltf-viewer>

See the component in action.

Usage

Here is a simple sample to get you started:

Important note: The example is great to try it out, but you should install the component if you build an application with <gltf-viewer> so you don't rely on external sources too much!

<!doctype html>
<html>
<head>
  <!--  polyfill for older browsers -->
  <script src="https://cdnjs.com/webcomponentsjs/webcomponents-lite.js"></script>

  <link rel="import" href="https://avgp.github.io/gltf-viewer/gltf-viewer.html">
</head>
<body>
  <gltf-viewer interactive src="/model.gltf"></gltf-viewer>
</body>
</html>

Installation

The component can be installed via Bower:

bower install gltf-viewer

Browser support & glTF support

The component supports:

  • Safari (OSX & iOS)
  • Opera
  • Firefox
  • Edge
  • Chrome & Android browser from 4.x upwards

The component supports both glTF 1.0 and glTF 2.0 models.

Contributing

If you think the component is missing something or you found a bug, please submit an issue and/or a pull request!

Setup for contributing

The easiest way to get going is to install the polymer-cli:

npm install -g polymer-cli

Then you can clone this repository to your local computer:

git clone https://github.com/avgp/gltf-viewer.git
cd gltf-viewer

You are now inside your cloned repository.

Serving the local component

If you have polymer-cli installed, go into your clone of this repository and run polymer serve in a terminal. You can access the demos via the URL that will be displayed and use the component locally.

Running Tests

$ polymer test

The component uses web-component-tester. Run polymer test to run your application's test suite locally.

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.