{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/14658","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/14658/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/14658/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/14658/events","html_url":"https://github.com/mrdoob/three.js/pull/14658","id":348410325,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NzY3MTA3","number":14658,"title":"Make Light targets optional","user":{"login":"mbredif","id":7373521,"node_id":"MDQ6VXNlcjczNzM1MjE=","avatar_url":"https://avatars1.githubusercontent.com/u/7373521?v=4","gravatar_id":"","url":"https://api.github.com/users/mbredif","html_url":"https://github.com/mbredif","followers_url":"https://api.github.com/users/mbredif/followers","following_url":"https://api.github.com/users/mbredif/following{/other_user}","gists_url":"https://api.github.com/users/mbredif/gists{/gist_id}","starred_url":"https://api.github.com/users/mbredif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbredif/subscriptions","organizations_url":"https://api.github.com/users/mbredif/orgs","repos_url":"https://api.github.com/users/mbredif/repos","events_url":"https://api.github.com/users/mbredif/events{/privacy}","received_events_url":"https://api.github.com/users/mbredif/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-07T17:09:11Z","updated_at":"2018-08-08T17:58:39Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/14658","html_url":"https://github.com/mrdoob/three.js/pull/14658","diff_url":"https://github.com/mrdoob/three.js/pull/14658.diff","patch_url":"https://github.com/mrdoob/three.js/pull/14658.patch"},"body":"(This PR is the geometric counterpart of #14621)\r\n\r\nThis enables the use of custom user-provided OrthographicCameras for DirectionalLights and PerspectiveCameras for SpotLights, by making optional the 2 hardwired updates that were updating the cameras at each frame : \r\n1. Light.target was unconditionnaly tracking an Object3D using its matrixWorld\r\n2. ~~SpotLightShadow.update was modifying the shadowCamera to have (most notably) its fov fit its cone angle.~~\r\n\r\nPossible use-cases are, combined with #14621, to do image-based rendering by backprojecting images as textured lights, with photogrammetrically-estimated camera parameters, or to more simply implement a slide or video projector with user-provided intrinsics/extrinsics (focal, aspect, position, rotation...).\r\n\r\nProposals :\r\n1. make target tracking opt-in : the default is undefined (no tracking). examples have been modified to either make a light.lookAt or assign a target object\r\n2. ~~make cone fitting opt-out : SpotLightShadow.cameraAutoUpdate is introduced (default: true) to disable the cone fitting of the camera.~~\r\n\r\nWDYT?\r\n\r\n--\r\nEdit : item 2 moved to its own PR (#14663)"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/411496792","html_url":"https://github.com/mrdoob/three.js/pull/14658#issuecomment-411496792","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/14658","id":411496792,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTQ5Njc5Mg==","user":{"login":"WestLangley","id":1000017,"node_id":"MDQ6VXNlcjEwMDAwMTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1000017?v=4","gravatar_id":"","url":"https://api.github.com/users/WestLangley","html_url":"https://github.com/WestLangley","followers_url":"https://api.github.com/users/WestLangley/followers","following_url":"https://api.github.com/users/WestLangley/following{/other_user}","gists_url":"https://api.github.com/users/WestLangley/gists{/gist_id}","starred_url":"https://api.github.com/users/WestLangley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WestLangley/subscriptions","organizations_url":"https://api.github.com/users/WestLangley/orgs","repos_url":"https://api.github.com/users/WestLangley/repos","events_url":"https://api.github.com/users/WestLangley/events{/privacy}","received_events_url":"https://api.github.com/users/WestLangley/received_events","type":"User","site_admin":false},"created_at":"2018-08-08T17:58:39Z","updated_at":"2018-08-08T17:58:39Z","author_association":"COLLABORATOR","body":">the world light direction should be accessed everywhere using light.getWorldDirection( direction ).negate();\r\n\r\nUnfortunately, that is a pretty inefficient method. I would avoid using it.\r\n\r\nMaybe try something like this:\r\n\r\n```javascript\r\nspotlight._target = new THREE.Object3D();\r\nspotlight._target.position.set( 0, 0, 1 );\r\nspotlight.add( _target );\r\n```\r\nYou can then get the world direction of the spotlight from the world matrices of `spotlight._target` and `spotlight`.\r\n\r\n"}}
{"actor":{"display_login":"WestLangley"}}