In my journey using three.js orbit controls, I have encountered a challenge of making a skybox follow the camera's position. Despite scouring the internet, I have not come across a suitable solution.
My query is straightforward - how can I obtain the accurate coordinates of the camera while utilizing orbit controls? The code snippet below did not yield the desired results:
skybox.position.x = camera.position.x; //Moving skybox with camera
skybox.position.z = camera.position.z; //Moving skybox with camera
skybox.position.y = camera.position.y; //Moving skybox with camera
The x and z values obtained are inaccurate. I also attempted:
orbit_controls.object.target
however, this led to similar incorrect outcomes with the x and z values being off. It seems that what should be a simple functionality of a control mechanism proves to be quite challenging.