@aardvarkxr/aardvark-react 中文文档教程
这个包是 React 组件的集合,可以轻松构建生成 Aardvark 场景图的小工具。
首先,cd 到一个空目录并键入:
npm init @aardvarkxr
这将安装 @aardvarkxr/create 脚本,然后运行它。 回答提示以设置您的小工具。
然后运行:
npm install
npm run build
之后您可能想要启动一个开发服务器以在开发期间托管您的小工具。 http-dev-server
适用于此。
npm install -g http-dev-server
http-dev-server --cors <path to gadget>
然后在本地浏览器中打开您的小工具以获得“添加到收藏夹”按钮,您可以在 Aardvark 的小工具菜单中看到它。 将小工具放入收藏夹后,您只需重建并重新加载它,而无需告诉 Aardvark 关于该小工具的任何新信息。 它只存储到小工具的链接,而不是任何内置的“二进制文件”。
您可以在 Visual Studio Code 中打开您的小工具目录,以帮助进行 react/aardvark 开发。
This package is a collection of React components that allow easy construction of gadgets that produce Aardvark scene graphs.
To get started, cd to an empty directory and type:
npm init @aardvarkxr
This will install the @aardvarkxr/create script and then run it. Answer the prompts to set up your gadget.
Then run:
npm install
npm run build
After that you probably want to start up a dev server to host your gadget during development. http-dev-server
works for that.
npm install -g http-dev-server
http-dev-server --cors <path to gadget>
Then open your gadget in a local browser to get an "add to favorites" button that will let you see it in Aardvark's gadget menu. Once you have the gadget in your favorites you can just rebuild and reload it without needing to tell Aardvark anything new about the gadget. It just stores a link to the gadget, not any of the built "binaries".
You can open your gadget directory in Visual Studio Code to aid in react/aardvark development.