Livelink.js
The Livelink.js SDK offers a JavaScript interface to interact with cloud-renderd 3D scene from a client application.
This is a reference documentation for the JavaScript library only. For a step by step introduction to the 3dverse platform, refer to the documentation website.
Overview
The SDK includes the following classes:
- SDK3DVerse
Start or join a rendering session. - engineAPI
Handle actions on entities. - cameraAPI
Handle viewports and camera controllers. - notifier
Subscribe to SDK events.
Setup
<html>
<head>
<meta charset="UTF-8" />
<meta content="width=device-width,initial-scale=1.0" name="viewport" />
</head>
<body>
<div class="canvas-container">
<!-- CANVAS -->
<canvas
id="display-canvas"
oncontextmenu="event.preventDefault()"
style="width: 100vw; height: 100vh;"
tabindex="1"
></canvas>
</div>
<!-- LIVELINK SDK -->
<script src="https://cdn.3dverse.com/legacy/sdk/latest/SDK3DVerse.js"></script>
<!-- APP ENTRYPOINT -->
<script type="module">
async function InitApp() {
await SDK3DVerse.joinOrStartSession({
userToken: "PUBLIC_TOKEN",
sceneUUID: "SCENE_UUID",
canvas: document.getElementById("display-canvas"),
viewportProperties: {
defaultControllerType: SDK3DVerse.controller_type.orbit,
},
});
}
window.addEventListener("load", InitApp);
</script>
</body>
</html>
Examples
Explore more starter examples at: https://github.com/3dverse/livelink-examples