我正在嘗試在場景中動畫相機的旋轉。觀看一個圓圈1秒後應該會發生動畫。A-Frame 0.6.1 - 相機旋轉動畫
問題是,在動畫之後,場景的底部似乎不可訪問,因爲它在動畫發生之前。
我首先試着對相機進行動畫製作,然後是相機的容器。第二種選擇產生了另一個問題,似乎所有的天空都是流離失所,我不知道如何「糾正」。
Video of the problem when the animation is on the camera
這裏有兩個codepens:
-
<script src="https://aframe.io/releases/0.6.1/aframe.min.js"></script> <script src="https://unpkg.com/aframe-animation-component/dist/aframe-animation-component.min.js"></script> <a-scene> <a-assets> <img id="city" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/city.jpg" data-position="0 0 0" alt="Table de conférence"> </a-assets> <a-sky src="#city" rotation="0 0 0"></a-sky> <a-circle position="-8 -5 2" rotation="90 0 0" geometry="radius: 1;" material="side: double;" > </a-circle> <a-entity id="camera-container" rotation="0 100 0"> <a-entity id="camera" look-controls camera="fov: 80; userHeight: 0" wasd-controls="enabled: false;"> <a-animation attribute="rotation" dur="1000" begin="animation__fuse-complete" from="-31.2 4 0" to="2 5.5 0" ></a-animation> <a-entity id="cursor" cursor="fuse: true; fuseTimeout: 100" position="0 0 -1" geometry="primitive: ring; radiusInner: 0.013; radiusOuter: 0.02" material="color: #000; shader: flat" animation__fuse="startEvents: fusing; property: scale; dur: 1000; to: 0.4 0.4 0.4" animation__fuseed="startEvents: animation__fuse-complete; property: scale; dur: 1; to: 1 1 1" > </a-entity> </a-entity> </a-entity>
-
<script src="https://aframe.io/releases/0.6.1/aframe.min.js"></script> <script src="https://unpkg.com/aframe-animation-component/dist/aframe-animation-component.min.js"></script> <a-scene> <a-assets> <img id="city" src="https://cdn.aframe.io/360-image-gallery-boilerplate/img/city.jpg" data-position="0 0 0" alt="Table de conférence"> </a-assets> <a-sky src="#city" rotation="0 0 0"></a-sky> <a-circle position="-8 -5 2" rotation="90 0 0" geometry="radius: 1;" material="side: double;" > </a-circle> <a-entity id="camera-container" rotation="0 100 0"> <a-animation attribute="rotation" dur="1000" begin="animation__fuse-complete" from="0 100 0" to="30 100 0"></a-animation> <a-entity id="camera" look-controls camera="fov: 80; userHeight: 0" wasd-controls="enabled: false;"> <a-entity id="cursor" cursor="fuse: true; fuseTimeout: 100" position="0 0 -1" geometry="primitive: ring; radiusInner: 0.013; radiusOuter: 0.02" material="color: #000; shader: flat" animation__fuse="startEvents: fusing; property: scale; dur: 1000; to: 0.4 0.4 0.4" animation__fuseed="startEvents: animation__fuse-complete; property: scale; dur: 1; to: 1 1 1"> </a-entity> </a-entity> </a-entity> </a-scene>
如何正確動畫攝像機轉動?
我在Windows 10,使用Chrome 59,A型架和0.6.1 AFRAME動畫分量
預先感謝您,並有一個愉快的一天!