@viewar/api-plugin-intelligentgraphics
v0.1.4
Published
Plugin for [viewar-api](https://www.npmjs.com/package/viewar-api) to import 3d scenes from [intelligentgraphics](https://www.intelligentgraphics.biz/) into the ViewAR system.
Downloads
18
Readme
@viewar/api-plugin-intelligentgraphics
Plugin for viewar-api to import 3d scenes from intelligentgraphics into the ViewAR system.
For more information about ViewAR, visit our developer portal at portal.viewar.com, or our website.
Usage
import viewarApi from 'viewar-api';
import { IntelligentgraphicsPlugin } from '@viewar/api-plugin-intelligentgraphics';
async function loadPlugin() {
// Initialize ViewAR API (needs to be done only once per app start).
await viewarApi.init();
// Register plugin for intelligent graphics model import.
const plugin = await viewarApi.plugins.register('intelligent graphics plugin', IntelligentgraphicsPlugin, {
igxr: 'moemax',
icomServer: 'https://dev2.viewar.com/proxy2.php?url=https://moemax-ar.moemax.com'
});
// Models from the plugin are added to the model manager and can be retrieved like every other model.
const modelId = "123lkasdf3";
const model = viewarApi.modelManager.findModelById(modelId);
// Insert model instance in the same way as a default model.
const instance = await viewarApi.sceneManager.insertModel(model);
console.log('Current property values', instance.propertyValues);
console.log('List of properties', instance.properties);
// Update model properties in the same way as a default model.
await instance.setPropertyValues({"Wood": "152"});
}