How to get bounding box information from a 3D object in aframe?

自闭症网瘾萝莉.ら 提交于 2019-12-02 06:34:35

You'll need to use A-Frame's underlying three.js APIs here. That answer has been posted for three.js before, but here's an A-Frame version:

// get three.js object from aframe entity
var el = document.querySelector('#my-element');
var object = el.getObject3D('mesh');

// compute bounding box
var bbox = new THREE.Box3().setFromObject(obj);
console.log(bbox.min, bbox.max)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!