{"id":23630988,"url":"https://github.com/donomii/scenecamera","last_synced_at":"2026-04-17T10:31:24.399Z","repository":{"id":57573319,"uuid":"65271026","full_name":"donomii/sceneCamera","owner":"donomii","description":"A 3D camera library, with FPS and RTS modes","archived":false,"fork":false,"pushed_at":"2024-09-01T21:56:08.000Z","size":1588,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T02:48:08.187Z","etag":null,"topics":["3d-camera","android","camera","fps","game","game-development","gamedev","matrix","opengl","opengl-es","rts","vector"],"latest_commit_sha":null,"homepage":"https://donomii.github.io/sceneCamera/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/donomii.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":"2016-08-09T06:58:04.000Z","updated_at":"2024-09-01T21:56:11.000Z","dependencies_parsed_at":"2024-06-20T12:49:01.558Z","dependency_job_id":"f85a562e-db7c-4fe7-9fe5-57d51e1b982a","html_url":"https://github.com/donomii/sceneCamera","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donomii%2FsceneCamera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donomii%2FsceneCamera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donomii%2FsceneCamera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donomii%2FsceneCamera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donomii","download_url":"https://codeload.github.com/donomii/sceneCamera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239551156,"owners_count":19657748,"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":["3d-camera","android","camera","fps","game","game-development","gamedev","matrix","opengl","opengl-es","rts","vector"],"created_at":"2024-12-28T02:48:10.802Z","updated_at":"2026-04-17T10:31:24.392Z","avatar_url":"https://github.com/donomii.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/donomii/sceneCamera.svg)](https://pkg.go.dev/github.com/donomii/sceneCamera)\n\nSceneCamera\n===========\n\nEasy 3D camera management\n\nDescription\n===========\n\nSceneCamera manages the camera for 3D applications.  It provides the V, in the GL trinity MVP.  And if needed, the P as well.\n\n![Demo](camerademo.gif)\n\nIt comes with 3 convenient modes, museum mode, first person mode, and RTS (Real Time Strategy) mode.\n\nIt is designed to work with OpenGL, but does not rely on any graphics libraries (just a matrix lib).  It could be used with other graphics libraries, but you may have to copy the matrices into your graphics library's matrix format.\n\n### Examples\n\nAn example program is included in the examples directory.  It can be run with\n\n    cd examples\n    go run .\n\n### Museum mode\nMuseum mode is a simple camera that orbits around a point, and can zoom in and out.  Draw your object at the origin, and the camera will orbit around it.  It is useful for inspecting 3D models from all angles.\n\n### First person mode / flight mode\n\nThe classic game mode.  Move forwards, backwards, strafe and turn.  It can also pitch, roll, and yaw, making it useful for flight simulators.\n\n### RTS mode\n\nThe camera floats over a ground plane.  Forwards, backwards and strafe slide the camera along the ground plane.  It can also spin around a point on the the map, using the pitch and yaw.\n\n## SBS (Side by Side) rendering\n\nSceneCamera provides the correct matrices for rendering in SBS (or twin display) mode.  Rather than taking control of the render like many graphics libraries, sceneCamera just hands you the matrices so that you can use them in your own render.  See the example directory for more details.\n\na quick summary:\n```\nfunc RenderStereoFrame(state *State) {\n    // Set the inter-pupilary distance.  Not critical, but the wrong value will make you feel sick.\n\tcamera.SetIPD(2.0)\n\n\t//get window width and height\n\twidth, height := MainWin.GetSize()\n\tcamera.Screenwidth = float32(width)/2\n\tcamera.Screenheight = float32(height)\n\n\n    //Get the view matrix for the left eye\n\tLeftviewMatrix := camera.LeftEyeViewMatrix()\n\n    //Get the projection matrix for the left eye\n\tLeftEyeFrustrum := camera.LeftEyeFrustrum()\n\n\t// Set the viewport to left half of the window\n\tgl.Viewport(0, 0, int32(width/2), int32(height))\n\n    //Render the scene to the left eye\n\tRenderFrame(state, LeftviewMatrix, LeftEyeFrustrum)\n\n\n\n    //Get the matrices for the right eye\n\tviewMatrix := camera.RightEyeViewMatrix()\n\tRightProjectionMatrix := camera.RightEyeFrustrum()\n\n    //Set the viewport to right half of the window\n\tgl.Viewport(int32(width/2), 0, int32(width/2), int32(height))\n\n    Draw the scene to the right eye display\n\tRenderFrame(state, viewMatrix, RightProjectionMatrix)\n\n\n\t//Set viewport to whole window\n\tgl.Viewport(0, 0, int32(width), int32(height))\n}\n```\n\n## Default position\n\nThe camera starts at z=5 (0,0,5), looking at the origin(0,0,0).  Positive Y is up (0,1,0).\n\nIn RTS mode, the camera starts at (10,10,10), looking at the origin(0,0,0).  Positive **Z** is up (0,0,1).  The ground plane is at z=0, covering the x and y axes.  i.e. the ground normal vector is (0,0,1).\n\nAll these settings can be changed by setting the appropriate field.\n\n## Typical use\n\n    import \"github.com/donomii/sceneCamera\"\n\n    //Create a new camera\n    camera := sceneCamera.New(2)  //FPS mode\n\n    camera.Move(0,0.5)  //Move forwards 0.5 world units\n\n    viewMatrix := camera.ViewMatrix()  //Get the view matrix for the camera\n\n\tcameraUniform := gl.GetUniformLocation(state.Program, gl.Str(\"camera\\x00\"))\n\tgl.UniformMatrix4fv(cameraUniform, 1, false, \u0026viewMatrix[0])\n\n    // Draw your scene\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonomii%2Fscenecamera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonomii%2Fscenecamera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonomii%2Fscenecamera/lists"}