I am currently modifying a path file in THREEJS for a 3D art gallery project. My goal is to ensure that the camera always faces perpendicular to the path it follows, rather than allowing users to adjust the camera target with the mouse as in the original file.
Essentially, I have created an array of view vectors that correspond to spline points along the camera path. Each time the camera reaches the next spline point, I aim to reset the camera view accordingly. However, when looping through the spline points and comparing them to the camera position, I consistently retrieve (0,0,0) as the camera position, even though the actual z position varies at different points along the path.
The line alert(this.object.position.z) simply outputs zero, despite the camera's z position not being zero initially or at most points. It appears that I am unable to access the camera position accurately. Any assistance on this matter would be greatly appreciated.