PrismarineJS/prismarine-viewer

Camera broken #42

Pandapip1 posted onGitHub

The problem is in src/index.js. The problem lines are:

camera.rotation.x = camera.rotation.x * 0.9 + pitch * 0.1
camera.rotation.y = camera.rotation.y * 0.9 + yaw * 0.1

This only works directionally. The fix is simple:

camera.lookAt(pos.x-Math.cos(pitch)*Math.sin(yaw), pos.y-Math.sin(pitch)+1.6, pos.z-Math.cos(pitch)*Math.cos(yaw))

Fund this Issue

$0.00
Funded

Pull requests