0.0.13 • Published 1 month ago

@resonai/vera-sdk v0.0.13

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

Resonai / Vera SDK

NPM Package NPM Downloads

Vera SDK library

This SDK allows creation of AR experiences based on JavaScript to run in Vera by Resonai.

Usage

This code requests appConfig and querySemanticObjects to get details about semantic objects currently is use. Then it creates a scene and a gltf mesh based on the queried data, and it adds the mesh to the scene.

import { veraApi } from '@resonai/vera-sdk'

veraApi.loaded()

const sceneID = 'helloWorldScene'

const appConfig = await veraApi.getAppConfig()
const place = appConfig.Place
const gltf = appConfig['Model URL']

const semanticObjectsDict = await veraApi.querySemanticObjects({
  confKey: appConfig._id,
  fields: ['id,type,name,key,argeometry{center_x,center_y,center_z}']
})
const semanticObject = semanticObjectsDict[place.key]
const geometry = semanticObject['ar:geometry']
const position = [geometry.center_x, geometry.center_y, geometry.center_z]
const meshObj = {
  sceneID,
  id: place._id,
  position,
  gltf
}

await veraApi.initScene({ sceneID })
await veraApi.mesh(meshObj)

Additional samples are available at https://github.com/resonai/com.resonai.hello-vera-js

Change log

N/A

0.0.13

1 month ago

0.0.12

4 months ago

0.0.11

6 months ago

0.0.10

10 months ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago