如何使 spinning/rotate 成为框架中的实体?

How to make spinning/rotate an entity in a-frame?

我想在 Y 轴上设置 entity spinning/rotating。 我这样试过:

  <a-entity position="-1 0.5 3" animation="property: rotation; to: 0 0 0 ; loop: true; elasticity:1000; dur: 10000" rotation="90 0 0">
    <a-box position="1 0 3" height="0" rotation="0 0 0" color="red"></a-box>
  </a-entity>

我也试过用动画标签制作,但这不是围绕轴。我该怎么做?

您的设置将参考框架从 90 0 0 旋转到 0 0 0

如果要绕其轴旋转盒子,请将动画组件附加到盒子:

<a-box position='' rotation='' animation=''></a-box>

fiddlehere


如果你想让它旋转另一个轴(Y),那么你需要在 Y轴:0 90 00 0 0

<a-entity animation='from: 0 90 0; to: 0 0 0'>
   <a-box></a-box>
</a-entity>

fiddle.

这里有一个演示,演示如何通过用光标在对象上滚动来旋转对象。它不使用动画,但每一帧都会稍微改变一下旋转。 https://glitch.com/~rollover-rotate