Я использую кадр 0.8.2 и пытаюсь добавить анимацию простоя камеры (только для компонента вращения).Я уже сделал это:
HTML:
<!-- Camera-->
<a-entity id = "my_c" position="8.435 0 -3.579" > <a-camera></a-camera></a-entity>
Javascript:
var scene = document.getElementById("my_s");
var camera = document.getElementById("my_c");
var anime_1 = document.createElement("a-animation");
/* Add a time of "not moving" */
var t;
window.onload = resetTimer;
// DOM Events
document.onkeypress = resetTimer;
document.onmousedown = resetTimer;
function standby() {
console.log("Start standby.");
anime_1.setAttribute("attribute","rotation");
console.log(camera.getAttribute("rotation"));
anime_1.setAttribute("dur", "80000");
anime_1.setAttribute("to", "0 360 0");
anime_1.setAttribute("easing", "linear");
anime_1.setAttribute("repeat", "indefinite");
camera.appendChild(anime_1);
}
function resetTimer() {
clearTimeout(t);
t = setTimeout(standby, 3000);
camera.removeChild(anime_1);
// 1000 milisec = 1 sec
}
Проблема в том, что моя камера не загружает свою позициюи вращение: когда я поворачиваю камеру, анимация простоя камеры не начинается с одной и той же позиции.
Спасибо за вашу поддержку:)