给定变量_roll和当前右方向向量,如何在旋转对象(在本例中为相机)时计算新的右向量?
import React, {Component} from 'react';
import Computer from './computer';
import './styles/computers.sass';
class Computers extends Component{
deleteComputer(_id){
this.props.onDelete(_id);
}
render(){
const compListStyle = {
display: 'grid',
gridTemplateColumns: 'repeat(4, 1fr)'
}
let computerList;
if(this.props.computers){
computerList = this.props.computers.map(x => {
console.log(x);
return(
<Computer computer={x} onDelete={this.deleteComputer.bind(this)}/>
)
})
}
return(
<div className='computers' style={this.compListStyle}>
{computerList}
</div>
);
}
}
export default Computers;
以上是我目前的想法,偏航工作正常,但滚动似乎产生了奇特的结果。我错过了什么吗?
编辑:经过一些实验,我也发现了: