【发布时间】:2019-08-04 23:54:44
【问题描述】:
我正在尝试像这样在 Aframe 中制作一个 rolodex 菜单。
这是目前的故障https://glitch.com/edit/#!/fourth-kitten
我正在尝试让实体通过相机旋转到视图中
AFRAME.registerComponent('rotate-with-camera', {
tick: function (){
console.log(this)
if(this.el.sceneEl.camera){
const {rotation} = this.el.sceneEl.camera.parent
const containerRotation = this.el.getAttribute('rotation')
this.el.setAttribute('rotation', {...containerRotation, z: containerRotation.y -= rotation._y * 360})
}
}
})
但是,我无法像此示例那样获得良好的平滑滚动,并且我对正确的数学运算感到困惑,以使其在上卷或下卷时保持在相机前以使下一行动画进入视野。
有什么想法吗?
【问题讨论】:
标签: view three.js menu camera aframe