Code Monkey home page Code Monkey logo

usd-viewer's Introduction

usd-viewer

npm version

usd-viewer demo

Experimental Web Component for rendering USDZ 3d format. Built on the experimental work and efforts of github.com/autodesk-forks/USD/tree/release

Instalation

npm install usd-viewer

Web Assembly Dependencies

Currently this depends on the SharedArrayBuffer so to enable in the browser the following response headers must be set:

"Cross-Origin-Embedder-Policy": "require-corp"
"Cross-Origin-Opener-Policy": "same-origin"

To load the Wasm dependencies in the browser copy them from the node_modules into your host env.

cpy node_modules/usd-viewer/wasm/**/* dist/wasm

To change the default path (./wasm) of the Wasm resources add the following meta tag to the document.

<meta name="usd-viewer:wasm" content="custom-path/wasm" />

Usage

<script type="module">
  import 'usd-viewer/include.js';
</script>

<usd-viewer src="./usd/perseverance.usdz" alt="Perseverance Mars Rover"></usd-viewer>

API

Property Attribute Type Description
src src string source path for usd/usdz file
alt alt string alt descriptive text
controls conrols boolean enable or disable model touch/mouse controls
fileName file-name boolean enable or disable display of file name
autoRotate auto-rotate boolean enable or disable auto rotation of model
autoRotateSpeed auto-rotate-speed number adjust speed of rotations of model
minDistance min-distance number minimum zoom distance of model
maxDistance max-distance number maximum zoom distance of model
zoom zoom number default zoom level of camera relative to model

Licensing

The Web Component of this project is MIT licensed, however refer to the following external dependencies and explicitly marked file headers. For additional license details see:

usd-viewer's People

Contributors

coryrylan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.