{"id":18924511,"url":"https://github.com/sharpcoder/webgl-engine","last_synced_at":"2025-06-25T17:04:09.856Z","repository":{"id":158859771,"uuid":"621382174","full_name":"SharpCoder/webgl-engine","owner":"SharpCoder","description":"A webGL game engine","archived":false,"fork":false,"pushed_at":"2023-12-22T15:06:47.000Z","size":223,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-31T17:38:14.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SharpCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-03-30T14:49:54.000Z","updated_at":"2023-09-24T22:43:35.000Z","dependencies_parsed_at":"2024-12-31T17:48:19.820Z","dependency_job_id":null,"html_url":"https://github.com/SharpCoder/webgl-engine","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/SharpCoder%2Fwebgl-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharpCoder%2Fwebgl-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharpCoder%2Fwebgl-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SharpCoder%2Fwebgl-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SharpCoder","download_url":"https://codeload.github.com/SharpCoder/webgl-engine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239921875,"owners_count":19718842,"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":[],"created_at":"2024-11-08T11:07:02.378Z","updated_at":"2025-02-20T21:58:42.921Z","avatar_url":"https://github.com/SharpCoder.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webgl-engine\n\nWebGL Engine is a typescript library for making games! It is intended as a learning platform to grow my openGL knowledge,\nas such, it's probably only useful for game jams and education. A lot of the concepts come from the wonderful [WebGL Fundamentals](https://webglfundamentals.org/)\nbut the engine itself is my own construct. I've taken their ideas and adapted it to something a little reusable.\n\n## Installation\n\nHmm, maybe copy the code and include it? This isn't published to npm, although, you can reference it in your package.json\nwith a little bit of magic. This is how I do it for other projects:\n\n```\n\"dependencies\": {\n    \"webgl-engine\": \"git+git@github.com:SharpCoder/webgl-engine.git\"\n},\n```\n\n## Usage\n\n```\nimport { Engine, Scene, cuboid, rads, Repeat, Vec3 } from 'webgl-engine';\n\n// In your project, something like this\nlet engine = new Engine();\n\n// Register the scenes\nconst DemoScene = new Scene({\n    title: 'demo'\n});\n\n\nconst RANGE = 2000;\nfor (let i = 0; i \u003c 300; i++) {\n    const positions = [\n        Math.random() * RANGE - Math.random() * RANGE,\n        Math.random() * RANGE - Math.random() * RANGE,\n        Math.random() * RANGE - Math.random() * RANGE,\n    ];\n\n    const scale = Math.random() * 50 + 10;\n    DemoScene.addObject({\n        position: positions,\n        vertexes: cuboid(scale, scale, scale),\n        dimensions: [scale, scale, scale],\n        offsets: [-scale / 2, -scale / 2, -scale / 2],\n        properties: {\n            rx: Math.random() * 20 + 2,\n            ry: Math.random() * 20 + 2,\n        },\n        colors: Flatten([\n            Repeat(Vec3(0, 199, 255), 6),\n            Repeat(Vec3(255, 0, 199), 6),\n            Repeat(Vec3(199, 255, 0), 6),\n            Repeat(Vec3(0, 255, 222), 6),\n            Repeat(Vec3(222, 0, 255), 6),\n            Repeat(Vec3(255, 222, 0), 6),\n        ]),\n        update: function (t: number) {\n            this.rotation[0] += rads((t * 1) / this.properties.rx);\n            this.rotation[1] += rads((-t * 1) / this.properties.ry);\n        },\n        rotation: [\n            rads(Math.random() * 360),\n            rads(Math.random() * 360),\n            rads(Math.random() * 360),\n        ],\n    });\n}\n\nengine.addScene(DemoScene);\n\n\nfunction draw() {\n    engine.draw();\n    requestAnimationFrame(draw.bind(this));\n}\n\nfunction update() {\n    engine.update();\n    requestAnimationFrame(update.bind(this));\n}\n\ndraw();\nupdate();\n```\n\n## Contributing\n\nI'm not sure anyone will want to contribute, but if you are so inspired, I'd gladly encourage discussions through\nthe issues feature on github.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpcoder%2Fwebgl-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharpcoder%2Fwebgl-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpcoder%2Fwebgl-engine/lists"}