aframe - Access A-Frame element from three.js object3D -
from a-frame, can access entity's object3d .object3d
or .getobject3d()
, there way reverse, when working three.js objects, element object belongs to? perhaps adding parent element userdata
?
a-frame attaches entity object3d
.el
.
for example entity mesh:
document.queryselector('a-entity').getobject3d('mesh').el;
it attaches group object3d
:
document.queryselector('a-entity').object3d.el;
this done during setobject3d()
.
for object3d
s a-frame not directly manage , not have direct associated a-frame entity, can walk scene graph find closest 1 object3d.traverseancestors
.
Comments
Post a Comment