{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/6784","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/6784/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/6784/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/6784/events","html_url":"https://github.com/mrdoob/three.js/issues/6784","id":92852849,"number":6784,"title":"\"Fit all\" (show all) feature","user":{"login":"pavelvasev","id":159179,"avatar_url":"https://avatars.githubusercontent.com/u/159179?v=3","gravatar_id":"","url":"https://api.github.com/users/pavelvasev","html_url":"https://github.com/pavelvasev","followers_url":"https://api.github.com/users/pavelvasev/followers","following_url":"https://api.github.com/users/pavelvasev/following{/other_user}","gists_url":"https://api.github.com/users/pavelvasev/gists{/gist_id}","starred_url":"https://api.github.com/users/pavelvasev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavelvasev/subscriptions","organizations_url":"https://api.github.com/users/pavelvasev/orgs","repos_url":"https://api.github.com/users/pavelvasev/repos","events_url":"https://api.github.com/users/pavelvasev/events{/privacy}","received_events_url":"https://api.github.com/users/pavelvasev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mrdoob/three.js/labels/Enhancement","name":"Enhancement","color":"deffdb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-07-03T11:10:41Z","updated_at":"2015-07-22T10:16:45Z","closed_at":null,"body":"Dear ThreeJS developers!\r\n\r\nPlease implement \"fit all\" (\"show all\") feature to the camera and/or OrbitControl and other controls.\r\nThis feature is very missing thing. \r\n\r\nTo provide some help, here is implementation of same feature in X3dom:\r\nhttps://github.com/x3dom/x3dom/blob/master/src/Viewarea.js#L1077\r\n\r\nAlso, there is \"fit object\" (e.g. show object) feature:\r\nhttps://github.com/x3dom/x3dom/blob/master/src/Runtime.js#L631\r\n\r\nMany thanks in advance.\r\n\r\nPlease do not refer me to other feature requests like https://github.com/mrdoob/three.js/issues/1095\r\n\r\nIf you deny to do this, please at least point me, where is it better to code it, e.g. in camera, or in OrbitControl/etc, to get them (camera and control) synchronized?\r\n"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/123652028","html_url":"https://github.com/mrdoob/three.js/issues/6784#issuecomment-123652028","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/6784","id":123652028,"user":{"login":"robhawkes","id":22612,"avatar_url":"https://avatars.githubusercontent.com/u/22612?v=3","gravatar_id":"","url":"https://api.github.com/users/robhawkes","html_url":"https://github.com/robhawkes","followers_url":"https://api.github.com/users/robhawkes/followers","following_url":"https://api.github.com/users/robhawkes/following{/other_user}","gists_url":"https://api.github.com/users/robhawkes/gists{/gist_id}","starred_url":"https://api.github.com/users/robhawkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robhawkes/subscriptions","organizations_url":"https://api.github.com/users/robhawkes/orgs","repos_url":"https://api.github.com/users/robhawkes/repos","events_url":"https://api.github.com/users/robhawkes/events{/privacy}","received_events_url":"https://api.github.com/users/robhawkes/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T10:16:45Z","updated_at":"2015-07-22T10:16:45Z","body":"I'm particularly interested in something like this myself for my work with ViziCities – there are situations where I have a Three.js scene within a HTML element that has strict dimensions and need to have the included objects fill that element (ideally with a definable padding / margin).\r\n\r\nCurrently, I'm using a mish-mash of formulas based on the various StackOverflow posts but my lack of understanding or something else is causing it to be far too verbose and complicated for my needs. It's also not quite right for some reason, probably because I need a solution that accommodates both width and height of the element, plus needs to accommodate objects that can be very wide or very tall (buildings).\r\n\r\nSomething like `camera.focusOn(Object3D)` or similar would be a good base for me to tweak and customise further for my needs. For example, I can use `camera.focusOn(Object3D)` and then pull the camera back a little from there as I need a little leeway as I have to ensure the object doesn't clip off the edges when animated with a 360 degree rotation (ie. when viewed at a diagonal)."}}