나는 너무 멀리했지만 동일한 결과를 보았습니다. 맞춤 이벤트에 의해 트리거 된 프레임의 애니메이션은 (x, y, z)에서 (x ', y' , z ')부터 (x', y ', z ")까지 (x', y ', z') 나는 애니메이션 속성을 가지고 놀았지만 결코 해결책을 찾지 못했습니다!A 프레임 애니메이션
<html>
<body>
<script src="https://aframe.io/releases/0.2.0/aframe.min.js"></script>
<script src="https://rawgit.com/ngokevin/aframe-layout-component/master/dist/aframe-layout-component.min.js"></script>
<a-scene>
<a-entity id="gallery" layout="type: line; margin: 1.2" position="0 0 3">
<a-plane id="one" color="#CCC" look-at="[camera]"></a-plane>
<a-plane id="two" color="#CCC" look-at="[camera]"></a-plane>
<a-plane id="three" color="#CCC" look-at="[camera]"></a-plane>
</a-entity>
<!--camera & env -->
<a-camera position="0 0 4" id="camera">
<a-entity cursor="fuse: true; maxDistance: 30; timeout: 500"
position="0 0 -.6"
scale=".01 .01 .01"
geometry="primitive: ring"
material="color: green; shader: flat">
</a-entity>
<a-animation attribute="position"
begin="one"
to="0 0 4"
dur="1000"
fill="forwards"
easing="ease-in-out-cubic"></a-animation>
<a-animation attribute="position"
begin="two"
to="1 0 4"
dur="1000"
fill="forwards"
easing="ease-in-out-cubic"></a-animation>
<a-animation attribute="position" begin="three" dur="1000" fill="forwards"
to="2 0 4"
easing="ease-in-out-cubic"></a-animation>
</a-camera>
<a-sky color="#ECECEC"></a-sky>
<a-light type="directional" color="#fff" intensity="0.2" position="-1 2 1"></a-light>
<a-light type="ambient" color="#fff"></a-light>
</a-scene>
</body>
</html>
자바 스크립트 : 여기
var one = document.querySelector('#one');
var two = document.querySelector('#two');
var three = document.querySelector('#three');
one.addEventListener('click', function() {
camera.emit('one');
});
two.addEventListener('click', function() {
camera.emit('two');
});
three.addEventListener('click', function() {
camera.emit('three');
});
는 codepen의 테스트입니다 : 여기에 문제의 http://codepen.io/anon/pen/OXaoKg
당신의 목표는 무엇입니까? 프로젝트가 작동하는 것처럼 보입니다. 각 객체를 볼 때 애니메이션이 생깁니다. – msj121
문제는 내가 이전 객체를 볼 때 카메라가 이전 객체에서 현재 객체로 이동하고 반대가 아닌 경우입니다 (현재 위치에서 이전 객체 위치로 이동하려고 함). –
이전 객체를 볼 때 그것은 중심으로보기로 스냅합니다. – msj121