This document provides a guide for using HTML Scripting to integrate Polygon Streaming into a PlayCanvas project that does not target publication to VIVERSE.
For PlayCanvas projects that are not targeting publication to VIVERSE, this PlayCanvas Direct HTML Plugin is the second path for integrating Polygon Streaming into those projects. Because these projects will not be published to VIVERSE, we've created a direct HTML version of the plugin that does not utilize the PlayCanvas VIVERSE Chrome browser extension.
1
Installation
// add Polygon Streaming SDK to your HTML with the correct version number
<script src="https://stream-stage.viverse.com/assets/streamablemodel/{LATEST_STABLE_VERSION}/PolygonStreaming.js"></script>
2
Plugin Usage
The script in PlayCanvas should be added to your HTML file after initializing of pc.Application, but before you attach the script component to the Entity and run Application.start()
// add a camera entity for Polygon Streaming SDK to use
const camera = new pc.Entity("camera");
camera.addComponent("camera", {
farClip: 1000,
nearClip: 0.1
});
app.root.addChild(camera);
3
Define an Entity
After then you need to define a new Entity, add it to the root and define the parameters (described in )