Skip to content

Looking-Glass/holoplaycore.js

Repository files navigation

HoloPlayCore.js

npm version npm bundle size npm

The HoloPlay Core SDK unlocks the ability to integrate your existing 3D software with Looking Glass displays, making the Looking Glass a holographic second monitor. This JavaScript version is ideal for web front-end and Node development. There's also a native dynamic library version for Windows, Mac, and Linux.

NPM PackageDocumentationForumDiscordOfficial Site

Installation

From npm:

npm install --save holoplay-core 

From CDN:

<script src="https://unpkg.com/holoplay-core"></script>

Usage

Include in html with script tag: (use holoplaycore.min.js for the minified version)

<script src="./node_modules/holoplay-core/dist/holoplaycore.js"></script>
<script>
  const client = new HoloPlayCore.Client(
      (msg) => {
        console.log('Calibration values:', msg);
      },
      (err) => {
        console.error('Error creating HoloPlay client:', err);
      });
</script>

or skip the script tag and import the ES6 module (note the different filename!):

<script type="module">
  import * as HoloPlayCore from './node_modules/holoplay-core/dist/holoplaycore.module.js';
  const client = new HoloPlayCore.Client(
      (msg) => {
        console.log('Calibration values:', msg);
      },
      (err) => {
        console.error('Error creating HoloPlay client:', err);
      });
</script>

or in node:

const HoloPlayCore = require('holoplay-core');
const client = new HoloPlayCore.Client(
      (msg) => {
        console.log('Calibration values:', msg);
      },
      (err) => {
        console.error('Error creating HoloPlay client:', err);
      });

Build

If you're developing HoloPlayCore.js and want to rebuild the dist version of this library, see BUILD.md.