Z指向上方还是Y指向上方?

时间:2017-09-11 21:15:39

标签: aframe

Rotation标签上的文档说Z是垂直的(偏航是绕垂直方向旋转) https://aframe.io/docs/0.6.0/components/rotation.html 但这个例子 https://codepen.io/bryik/pen/GZLoQv

  <!-- y-roll or "yaw" --> 
  <a-plane id="yaw" material="color: #4CC3D9; side: double" position="0 2 0" rotation="0 45 0" width="2" height="2"></a-plane>

显示Y指向,而不是Z. 文档中是否只是一个错误?

1 个答案:

答案 0 :(得分:0)

文档可能会被窃听,但这实际上取决于您的方向。 (Z通常是偏航)

<script src="https://aframe.io/releases/0.6.1/aframe.min.js"></script>
<a-scene>
  <a-text value="PITCH (X)" color="#333" position="-0.5 5.5 -5"></a-text>
  <a-plane position="0 4 -5" rotation="0 0 0" width="2" height="2" color="blue"><a-animation attribute="rotation"
               dur="800"
               fill="none"
               to="360 0 0"
               repeat="forwards"
               ></a-animation></a-plane>
  <a-text value="YAW (Y)" color="#333" position="-3.5 3.5 -5"></a-text>
  <a-plane position="-3 2 -5" rotation="0 0 0" width="2" height="2" color="green"><a-animation attribute="rotation"
               dur="800"
               fill="none"
               to="0 360 0"
               repeat="forwards"
               ></a-animation></a-plane>
  <a-text value="ROLL (Z)" color="#333" position="2.5 3.5 -5"></a-text>
  <a-plane position="3 2 -5" rotation="0 0 0" width="2" height="2" color="red"><a-animation attribute="rotation"
               dur="800"
               fill="none"
               to="0 0 360"
               repeat="forwards"
               ></a-animation></a-plane>
</a-scene>  

https://jsfiddle.net/f922j0th/