我正在努力为盒子原语创建一个线框.尝试过颜色,不透明度和透明属性但似乎没有效果.这是代码 -
<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>
Run Code Online (Sandbox Code Playgroud)
需要渲染这样的东西 -
你会想要查看这个的THREE.Material文档,因为A-Frame不能公开每个选项.这是一个示例组件,使用wireframe选项:
AFRAME.registerComponent('wireframe', {
dependencies: ['material'],
init: function () {
this.el.components.material.material.wireframe = true;
}
});
Run Code Online (Sandbox Code Playgroud)
<a-entity geometry="primitive: box" material="color: blue" wireframe></a-entity>
Run Code Online (Sandbox Code Playgroud)