0.0.13 • Published 1 year ago

@resonai/vera-sdk v0.0.13

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year 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 year ago

0.0.12

1 year ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago