我正在努力为盒子基元创建线框。尝试了颜色、不透明度和透明属性,但似乎都不起作用。这是代码 -
<a-entity geometry="primitive: box; width: 1; height: 1; depth: 1" position="0 1 0" material="color: #0000FF; opacity: 0.5;" rotation="0 0 120"></a-entity>
需要渲染这样的东西 -
最佳答案
您需要查看THREE.Material docs对于这个,有一点需要注意,因为 A 型框架无法公开每个选项。这是一个使用 wireframe
选项的示例组件:
AFRAME.registerComponent('wireframe', {
dependencies: ['material'],
init: function () {
this.el.components.material.material.wireframe = true;
}
});
<小时/>
<a-entity geometry="primitive: box" material="color: blue" wireframe></a-entity>
关于aframe - 如何在框架中创建线框 3D 立方体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38850411/