Reputation: 2994
My main goal is to be able to position the camera such that my object is visible dynamically.
I have read: How to Fit Camera to Object
which says I need fov
, height
and dist
, and to me they all are unknown variables since I have not found a way to get all 3.
P.S: I'm very new to three.js
Upvotes: 0
Views: 723
Reputation: 91
Adjust the field of view of your camera:
var fov = 50;
var camera = new THREE.PerspectiveCamera(fov, width/height, 0.1, 10000);
The higher the value of fov, the more space the camera can see.
To always have your object visible, do this:
camera.lookAt( object.position );
Upvotes: 1