{"id":16126792,"url":"https://github.com/mikolalysenko/game-shell-orbit-camera","last_synced_at":"2025-08-11T06:05:46.619Z","repository":{"id":9370989,"uuid":"11227598","full_name":"mikolalysenko/game-shell-orbit-camera","owner":"mikolalysenko","description":"Attaches an orbit-camera to a game-shell instance with default key bindings","archived":false,"fork":false,"pushed_at":"2014-05-21T12:06:39.000Z","size":144,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-09T06:41:30.932Z","etag":null,"topics":[],"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/mikolalysenko.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}},"created_at":"2013-07-07T02:48:18.000Z","updated_at":"2025-04-02T16:19:20.000Z","dependencies_parsed_at":"2022-08-19T16:50:04.937Z","dependency_job_id":null,"html_url":"https://github.com/mikolalysenko/game-shell-orbit-camera","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikolalysenko/game-shell-orbit-camera","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Fgame-shell-orbit-camera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Fgame-shell-orbit-camera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Fgame-shell-orbit-camera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Fgame-shell-orbit-camera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikolalysenko","download_url":"https://codeload.github.com/mikolalysenko/game-shell-orbit-camera/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Fgame-shell-orbit-camera/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269711858,"owners_count":24463201,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-09T21:40:24.036Z","updated_at":"2025-08-11T06:05:46.574Z","avatar_url":"https://github.com/mikolalysenko.png","language":"JavaScript","readme":"game-shell-orbit-camera\n=======================\nCreates a default orbit camera controller for a [game-shell](https://github.com/mikolalysenko/game-shell) instance.  The controls for this are as follows:\n\n* Rotate - Left click\n* Pan - Right click or Control + Left click\n* Zoom - Scroll or Shift + Left click\n\n## Example\n\n\"use strict\"\n\n```javascript\nvar shell = require(\"gl-now\")()\nvar createMesh = require(\"gl-mesh\")\nvar simple3DShader = require(\"simple-3d-shader\")\nvar attachCamera = require(\"game-shell-orbit-camera\")\nvar glm = require(\"gl-matrix\")\nvar mat4 = glm.mat4\n\nvar shader, mesh\nvar camera = attachCamera(shell)\n\ncamera.lookAt([0, 3, 20], [0, 3, 0], [0, 1, 0])\n\nshell.on(\"gl-init\", function() {\n  shader = simple3DShader(shell.gl)\n  mesh = createMesh(shell.gl, require(\"bunny\"))\n})\n\nshell.on(\"gl-render\", function(t) {\n  //Bind shader\n  shader.bind()\n\n  //Set camera parameters\n  var scratch = mat4.create()\n  shader.uniforms.model = scratch\n  shader.uniforms.projection = mat4.perspective(scratch, Math.PI/4.0, shell.width/shell.height, 0.1, 1000.0)\n  shader.uniforms.view = camera.view(scratch)\n  \n  //Draw object\n  mesh.bind(shader)\n  mesh.draw()\n  mesh.unbind()\n})\n```\n\n## Install\n\n    npm install game-shell-orbit-camera\n\n\n### `require(\"game-shell-orbit-camera\")(shell)`\nAttaches a camera to the game-shell instance\n\n**Returns** An instance of [`orbit-camera`](https://github.com/mikolalysenko/orbit-camera)\n\n## Credits\n(c) 2013 Mikola Lysenko. MIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikolalysenko%2Fgame-shell-orbit-camera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikolalysenko%2Fgame-shell-orbit-camera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikolalysenko%2Fgame-shell-orbit-camera/lists"}