Just looking for some additional advice here. I have written a player follow camera without using orbitcontrols. Used spherical coordinate formulae to update the mouse position on mouse drag. I raycast to the expected position of the camera, and if intersection found, i update the camera’s position to the intersection position of the raycast.
Some code:
if (intersects.length) {
const offsetVector = directionVector.multiplyScalar(-0.25);
this.camera.position.copy(
intersects[0].point.clone().add(offsetVector.clone())
);
}
However, this solution isn’t perfect. @mjurczyk if you do see this, would love to know where I can learn more about the fov based padding approach. I tried sphere collisions like you mentioned, but i suspect it performs well in closed spaces (small room glb files). When the mouse is moved fast, the backfaces of the intersected meshes still show.
Would love to learn more from you guys!
@VForsmann what solution worked best for you? @seanwasere any inputs that you might have?