@realsee/dnalogel 将 如视(realsee.com) VR 空间交互 常用能力沉淀,并以 Five Plugins
形式进行抽象。
结合如视三维空间重建渲染引擎 Five
与 如视开放 API ,可以制作出丰富多彩的三维空间应用。不论是经过线上环境千锤百炼的刚需功能,还是灵感一现的炫酷尝试,所有已经落地的功能我们均毫无保留的开源至github realsee-developer/dnalogel 。
1、安装
npm install @realsee/dnalogel
yarn add @realsee/dnalogel
2、插件注册
import { Five } from '@realsee/five'
import { Plugin } from '@realsee/dnalogel'
const five = new Five({
plugins: [[Plugin, 'PluginName', initOptions]],
})
3、插件方法使用
// 不同插件提供的方法可能存在差异,请参考各插件 API 文档
five.plugins.PluginName.load(data)
five.plugins.PluginName.enable()
five.plugins.PluginName.disable()
five.plugins.PluginName.dispose()
4、插件依赖数据获取
您可以通过 open API 查看数据获取方式及相关 open API 。
我们为每个插件书写了简单的效果示例,您可点击预览: @realsee/dnalogel showcase
Module not found: Error: Can't resolve '@realsee/five/line' in 'xxx/node_modules/@realsee/dnalogel/libs'
Did you mean 'index.js'?
BREAKING CHANGE: The request '@realsee/five/line' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
解决方案:在webpack配置里加以下rule 参考:resolvefullyspecified
{
test: /\.m?js$/,
resolve: {
fullySpecified: false, // disable the behaviour
},
},