A框架:如何使用setObject3D向实体添加多个网格? [英] A-Frame: How do you add multiple meshes to an entity with setObject3D?

查看:55
本文介绍了A框架:如何使用setObject3D向实体添加多个网格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用A-Frames标签,可以将多个组件作为子级添加到实体:

With A-Frames tags, one can add multiple components as children to an entity:

<a-scene>
  <a-entity>
   <a-box>...</a-box>
   <a-box>...</a-box> 
 </a-entity>
<a-scene>

如何使用setObject3D方法在已注册的组件中复制它?

How would you duplicate this in a registered component with the setObject3D method?

CodePen: https://codepen.io/ubermario/pen/wrwjVG

推荐答案

是的,您可以根据需要命名object3D。 mesh 一词只是网格常用的一种,并且被几何/材质组件使用。要澄清:

Yup, you can name the object3D however you want. The mesh word is just sort of commonly accepted for meshes and used by geometry/material components. To clarify:

setObject3D('mesh')

setObject3D('yourobject')

setObject3D('whateveryouwantbox');

这篇关于A框架:如何使用setObject3D向实体添加多个网格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆