简单的PBR应用,该例子仅有简单全局光,多依赖环境光,优化金属光泽及车漆效果,材质直接使用threejs editor编辑好导出glb直接使用。已开发控制遥杆进行运动控制。

主要运动控制代码:
var brakingDeceleration = 1;
if (this.touchControls.brake) brakingDeceleration = this.brakePower;
if (this.touchControls.moveForward) {
this.speed = THREE.Math.clamp(this.speed - delta * this.acceleration, maxSpeedReverse, this.maxSpeed);
acceleration = THREE.Math.clamp(acceleration - delta, -1, 1);
}
if (this.touchControls.moveBackward) {
this.speed = THREE.Math.clamp(this.speed + delta * accelerationReverse, maxSpeedReverse, this.maxSpeed);
acceleration = THREE.Math.clamp(acceleration + delta, -1, 1);
}
if (this.touchControls.moveLeft) {
wheelOrientation = THREE.Math.clamp(wheelOrientation + delta * steeringWheelSpeed, -maxSteeringRotation, maxSte

博客介绍了简单的PBR应用,该应用有简单全局光,多依赖环境光,优化了金属光泽及车漆效果,材质使用threejs editor编辑导出的glb。同时已开发控制遥杆进行运动控制,还给出了主要运动控制代码和演示地址。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



