{"id":19564307,"url":"https://github.com/ronenness/simpleorbitcontrols","last_synced_at":"2025-04-27T00:32:53.912Z","repository":{"id":82588254,"uuid":"233137746","full_name":"RonenNess/SimpleOrbitControls","owner":"RonenNess","description":"A simple alternative to THREE.js OrbitControls class.","archived":false,"fork":false,"pushed_at":"2020-01-11T20:29:15.000Z","size":248,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T19:07:51.801Z","etag":null,"topics":["camera","threejs","threejs-example","webgl2"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RonenNess.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-10T22:03:32.000Z","updated_at":"2025-04-04T10:09:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"89356d3e-3345-44c3-a9d0-1e4a77dc976d","html_url":"https://github.com/RonenNess/SimpleOrbitControls","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RonenNess%2FSimpleOrbitControls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RonenNess%2FSimpleOrbitControls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RonenNess%2FSimpleOrbitControls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RonenNess%2FSimpleOrbitControls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RonenNess","download_url":"https://codeload.github.com/RonenNess/SimpleOrbitControls/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251073259,"owners_count":21532005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camera","threejs","threejs-example","webgl2"],"created_at":"2024-11-11T05:21:22.196Z","updated_at":"2025-04-27T00:32:53.898Z","avatar_url":"https://github.com/RonenNess.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleOrbitControls\n\nAn alternative to the default OrbitControls provided by THREE.js examples.\n\nLive demo can be found [here](https://ronenness.github.io/SimpleOrbitControls/demo/).\n\n`Note: demo only works on desktop; to use on mobile you need to register to touch events and provide them as input (see usage for more info).`\n\n# What Is It\n\nTHREE.js examples comes with a great [Orbit Camera Controller](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js). \n\nWhile its very useful and a good starting point, I wanted something slightly different, mainly a controller that don't interact with events internally (and instead being controlled from outside) and wanted to use Lerping instead of delta and damping, which feels different imo.\n\nSo I created this class instead, rewritten from scratch. Its a shorter, more basic implementation, which I believe is easier to understand and modify to more specific needs. \n\n# Usage\n\nSimpleOrbitControls does not register to any browser events **by design**. That means that you need to implement that part on your own and provide input commands every update call:\n\n```js\n// create the orbit controller\nvar controls = new THREE.SimpleOrbitControls(renderer, scene, camera);\n\n// inside your main loop, call this every update call:\nvar controllerInput = {\n    deltaTime: deltaTime,                                      // time passed, in seconds, since last update call\n    rotateHorizontally: rotateHorizontally,                    // rotation around y axis\n    rotateVertically: rotateVertically,                        // rotate vertically around x / z axis\n    moveOffsetVertically: moveY,                               // move the target offset (affect lookat AND camera position), along camera's Y axis. \n    moveOffsetHorizontally: moveXZ,                            // move the target offset left / right, relative to camera's world direction.\n    zoom: zoom,                                                // zoom in / out\n}\ncontrols.update(controllerInput);\n```\n\nFor more info, check out the example under `demo/`.\n\n# License\n\nMIT, you can use it for any purpose.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronenness%2Fsimpleorbitcontrols","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fronenness%2Fsimpleorbitcontrols","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronenness%2Fsimpleorbitcontrols/lists"}