I'm new to Three.js, so if this is obvious then apologies upfront.
I set my camera using the LookAt method, and would like to move along that vector when pressing a key on the keyboard.
I've tried mimicking the feature by subtracting the camera vector from the point I'm looking at via subVector
, normalized the resulting vector, then did something along the lines of:
camera.position.x += lookAtVector.x
camera.position.y += lookAtVector.y
camera.position.z += lookAtVector.z
...but I appear to be drifting a bit and not moving toward the lookAt point when I do this. How can I move along a lookAt vector in three.js?