{"id":26716457,"url":"https://github.com/diwi/p5.easycam","last_synced_at":"2025-07-06T15:38:08.704Z","repository":{"id":43270205,"uuid":"115871819","full_name":"diwi/p5.EasyCam","owner":"diwi","description":"A p5.js library for easy 3D camera control.","archived":false,"fork":false,"pushed_at":"2018-10-30T20:08:54.000Z","size":2988,"stargazers_count":122,"open_issues_count":15,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-14T01:31:09.145Z","etag":null,"topics":["3d","3d-camera-control","camera","easycam","orbit","p5","p5js","peasycam","processing","trackball","webgl"],"latest_commit_sha":null,"homepage":"https://diwi.github.io/p5.EasyCam/","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/diwi.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":"2017-12-31T15:47:55.000Z","updated_at":"2025-02-18T00:34:04.000Z","dependencies_parsed_at":"2022-08-12T10:21:34.410Z","dependency_job_id":null,"html_url":"https://github.com/diwi/p5.EasyCam","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/diwi/p5.EasyCam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diwi%2Fp5.EasyCam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diwi%2Fp5.EasyCam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diwi%2Fp5.EasyCam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diwi%2Fp5.EasyCam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diwi","download_url":"https://codeload.github.com/diwi/p5.EasyCam/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diwi%2Fp5.EasyCam/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263926550,"owners_count":23531108,"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","3d-camera-control","camera","easycam","orbit","p5","p5js","peasycam","processing","trackball","webgl"],"created_at":"2025-03-27T15:27:33.675Z","updated_at":"2025-07-06T15:38:08.669Z","avatar_url":"https://github.com/diwi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![MultiView](screenshots/RandomBoxes_crop.jpg)\n\n\n# p5.EasyCam\n\nSimple 3D camera control for [p5js](https://p5js.org/) and the WEBGL/P3D renderer.\n\nThis library is a derivative of the original PeasyCam Library by Jonathan Feinberg \nand combines new useful features with the great look and feel of the original version.\n\nProcessing/Java version of this project: https://github.com/diwi/peasycam/tree/PeasyCam3\n\n\n## Releases\n\n- [p5.easycam.js](https://rawgit.com/diwi/p5.EasyCam/master/p5.easycam.js)\n- [p5.easycam.min.js](https://rawgit.com/diwi/p5.EasyCam/master/p5.easycam.min.js)\n- [All Releases](https://github.com/diwi/p5.EasyCam/releases)\n\n\n## Examples\n\n#### EasyCam.js - Advanced Shader/Lighting\n- [RandomBoxes](https://diwi.github.io/p5.EasyCam/examples/RandomBoxes/)\n- [AnimatedPointLights](https://diwi.github.io/p5.EasyCam/examples/AnimatedPointLights/)\n- [PerPixelPhong](https://diwi.github.io/p5.EasyCam/examples/PerPixelPhong/)\n\n#### EasyCam.js - Basic\n- [CameraStates](https://diwi.github.io/p5.EasyCam/examples/CameraStates/)\n- [CameraStates_Basic](https://diwi.github.io/p5.EasyCam/examples/CameraStates_Basic/)\n- [HeadUpDisplay](https://diwi.github.io/p5.EasyCam/examples/HeadUpDisplay/)\n- [QuickStart](https://diwi.github.io/p5.EasyCam/examples/QuickStart/)\n- [QuickStart_Ortho](https://diwi.github.io/p5.EasyCam/examples/QuickStart_Ortho/)\n- [SplitView](https://diwi.github.io/p5.EasyCam/examples/SplitView/)\n- [MultiView](https://diwi.github.io/p5.EasyCam/examples/MultiView/)\n\n#### dwgl.js - WebGL1/WebGL2 wrapper\n- [ReactionDiffusion](https://diwi.github.io/p5.EasyCam/examples/ReactionDiffusion_Webgl2/)\n\n\n## Usage\n\n```javascript\nvar easycam;\n\nfunction setup() { \n  createCanvas(windowWidth, windowHeight, WEBGL);\n\n  easycam = createEasyCam();\n  // easycam = new Dw.EasyCam(this._renderer);\n  // easycam = new Dw.EasyCam(this._renderer, {distance:300, center:[0,0,0]});\n  // easycam = new Dw.EasyCam(this._renderer, {distance:300, center:[0,0,0], rotation:[1,0,0,0]});\n} \n\nfunction draw(){\n  background(64);\n  fill(255);\n  box(200);\n}\n```\nsomething to play: [jsfiddle](https://jsfiddle.net/wqjugp9m/7/)\n\n\n## Reference\n\n  - [p5.EasyCam.documentation](https://diwi.github.io/p5.EasyCam/documentation/)\n  \n  \n```javascript\n\n##\n## QUICKREF\n##\n\n\n## CAMERA SETUP\n\n// constructor\nnew Dw.EasyCam(p5.RendererGL, state);\nnew Dw.EasyCam(p5.RendererGL, {\n      distance : z,                 // scalar (optional)\n      center   : [x, y, z],         // vector (optional)\n      rotation : [q0, q1, q2, q3],  // quaternion (optional)\n      viewport : [x, y, w, h],      // array (optional)\n    }\n\n// examples\ncreateEasyCam(); // uses the primary WEBGL renderer and default settings\n ...\ncreateEasyCam(p5.RendererGL);\ncreateEasyCam(p5.RendererGL, {distance:z});\ncreateEasyCam(p5.RendererGL, {distance:z, center:[x,y,z]});\n  ... \nnew Dw.EasyCam(p5.RendererGL);\nnew Dw.EasyCam(p5.RendererGL, {distance:z});\nnew Dw.EasyCam(p5.RendererGL, {distance:z, center:[x,y,z]});\n  ... \n\n## CAMERA STATE\n\nstate = {\n  distance : z,                 // scalar\n  center   : [x, y, z],         // vector\n  rotation : [q0, q1, q2, q3],  // quaternion\n}\n\n\n## CAMERA METHODS\n\n// CAMERA, MISC\nsetCanvas(renderer) // webgl-renderer\ngetCanvas()\nsetViewport(viewport) // viewport as bounding screen-rectangle [x,y,w,h]\ngetViewport()\nupdate() // update camera state\napply(renderer) // apply camera state to webgl-renderer\ndispose()\nsetAutoUpdate(status)\ngetAutoUpdate()\nattachMouseListeners(renderer) // input handler\nremoveMouseListeners()\n\n// INPUT BEHAVIOUR/SCALE/SPEED\nsetZoomScale(scale_zoom)\ngetZoomScale()\nsetPanScale(scale_pan)\ngetPanScale()\nsetRotationScale(scale_rotation)\ngetRotationScale()\nsetWheelScale(wheelScale)\ngetWheelScale()\nsetDefaultInterpolationTime(duration)\nsetDamping(damping)\nsetRotationConstraint(yaw, pitch, roll)\n\n// GET ZOOM/PAN/ROTATE/POSITION/UP\ngetCenter()\ngetDistance()\ngetRotation()\ngetUpVector(dst)\ngetPosition(dst)\n\n// SET ZOOM/PAN/ROTATE\nsetDistanceMin(distance_min)\nsetDistanceMax(distance_max)\nsetDistance(distance, duration)\nsetCenter(center, duration)\nsetRotation(rotation, duration)\nsetInterpolatedCenter(valA, valB, t)\nsetInterpolatedDistance(valA, valB, t)\nsetInterpolatedRotation(valA, valB, t)\n\n// MODIFY ZOOM/PAN/ROTATE\nzoom(dz)\npanX(dx)\npanY(dy)\npan(dx, dy)\nrotateX(rx)\nrotateY(ry)\nrotateZ(rz)\nrotate(axis, angle)\n\n// CAMERA STATES\nsetState(other, duration)\ngetState()\npushState()\npopState(duration)\npushResetState()\nreset(duration)\n\n// HEAD_UP_DISPLAY\nbeginHUD(renderer, w, h)\nendHUD(renderer)\n\n```\n\n\n## Screenshots\n\n![RandomBoxes](screenshots/RandomBoxes.jpg)\n\n![MultiView](screenshots/MultiView.jpg)\n\n![PerPixelPhong](screenshots/PerPixelPhong.jpg)\n\n![CameraStates](screenshots/CameraStates.jpg)\n\n![ReactionDiffusion](screenshots/dwgl_ReactionDiffusion.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiwi%2Fp5.easycam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiwi%2Fp5.easycam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiwi%2Fp5.easycam/lists"}