{"id":13740288,"url":"https://github.com/kooparse/mogwai","last_synced_at":"2025-07-19T21:32:49.551Z","repository":{"id":78350538,"uuid":"310047968","full_name":"kooparse/mogwai","owner":"kooparse","description":"Graphic utility used to manipulate objects in 3D for scene editing (commonly called Gizmo).","archived":false,"fork":false,"pushed_at":"2022-11-03T11:46:24.000Z","size":978,"stargazers_count":17,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-17T17:16:09.093Z","etag":null,"topics":["game-engine","gamedev","gizmo","graphics-engine","scene-editor","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/kooparse.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}},"created_at":"2020-11-04T15:49:44.000Z","updated_at":"2025-07-03T08:03:38.000Z","dependencies_parsed_at":"2023-03-17T05:00:14.238Z","dependency_job_id":null,"html_url":"https://github.com/kooparse/mogwai","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kooparse/mogwai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kooparse%2Fmogwai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kooparse%2Fmogwai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kooparse%2Fmogwai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kooparse%2Fmogwai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kooparse","download_url":"https://codeload.github.com/kooparse/mogwai/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kooparse%2Fmogwai/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266019657,"owners_count":23864916,"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":["game-engine","gamedev","gizmo","graphics-engine","scene-editor","zig"],"created_at":"2024-08-03T04:00:45.784Z","updated_at":"2025-07-19T21:32:49.525Z","avatar_url":"https://github.com/kooparse.png","language":"Zig","funding_links":[],"categories":["Applications"],"sub_categories":[],"readme":"# Mogwai\n\nGraphic utility used to manipulate objects in 3D for scene editing (commonly called Gizmo).\n\nIt's a straightforward and simple Gizmo, all the manipulation is computed in this library \nwhile it gives you all the verticies for your renderer; At the end, \nyou'll get a decomposed matrix (three vec3 for translation/rotation/scale). \n\nThis library uses only [zalgebra](https://github.com/kooparse/zalgebra) and the `std`!\n\n\u003cimg src=\"https://github.com/kooparse/mogwai/blob/master/.github/mogwai.png\" alt=\"preview\" /\u003e\n\n## Examples\n\n```zig\nusingnamespace @import(\"mogwai\");\n\npub fn main () void {\n  var gizmo = Mogwai(.{\n    .screen_width   = 800,\n    .screen_height  = 600,\n    .snap_axis = 0.5,\n    .snap_angle = 5 \n  });\n\n  // Get all vertices for your renderer.\n  const xy_panel = gizmo.meshes.move_panels.xy;\n  const yz_panel = gizmo.meshes.move_panels.yz\n  // See https://github.com/kooparse/mogwai/blob/master/exemples/_glfw_opengl.zig#L62-L73\n  // for all meshes.\n\n  // Mode is an enum containing all different modes\n  // for the gizmo (move, rotate, scale, none).\n  var gizmo_mode = Mode.Move;\n\n  while(true) {\n    // After pulling cursor state and positions:\n    gizmo.setCursor(pos_x, pos_y, is_pressed);\n    // After updating the view matrix (camera moving...).\n    gizmo.setCamera(view, proj);\n\n    // You just have to pass a mode and the model matrix from the\n    // selected object from your scene.\n    if (gizmo.manipulate(target_model_matrix, gizmo_mode)) |result| {\n        switch (result.mode) {\n            Mode.Move =\u003e {\n                target.transform.position = result.position;\n            },\n            Mode.Rotate =\u003e {\n                target.transform.rotation = result.rotation.extractRotation();\n            },\n            Mode.Scale =\u003e {\n                target.transform.scale = result.scale;\n            },\n            else =\u003e {},\n        }\n    }\n\n    // Draw all the meshes\n    your_renderer.draw(\u0026yz_panel, gizmo.is_hover(GizmoItem.PanelYZ));\n  }\n}\n```\nSee https://github.com/kooparse/mogwai/blob/master/exemples/_glfw_opengl.zig for a real exemple.\n\n## Documentation\n\n### Config\n\nField | Type | Description\n------------ | ------------- | -------------\nscreen_width | i32 | Width of the screen (required)\nscreen_height | i32 | Height of the screen (required)\ndpi | i32 | Pixel ratio of your monitor\nsnap | ?f32 | Snap when dragging gizmo, value is equals to floor factor\narcball_radius | f32 | Radius of the rotation circles\narcball_thickness | f32 | Width of the rotation circle borders\npanel_size| f32 | The width/height of panels\npanel_offset| f32 | Offset of the panels from the origin position\npanel_width| f32 | Plans width for panels\naxis_length | f32 | Length of arrows\naxis_size | f32 | The width/height of arrows\nscale_box_size | f32 | Size of the scaler boxes\n\n\n## Contributing to the project\n\nDon’t be shy about shooting any questions you may have. If you are a beginner/junior, don’t hesitate, I will always encourage you. It’s a safe place here. Also, I would be very happy to receive any kind of pull requests, you will have (at least) some feedback/guidance rapidly.\n\nBehind screens, there are human beings, living any sort of story. So be always kind and respectful, because we all sheer to learn new things.\n\n\n## Thanks\nThis project is inspired by [tinygizmo](https://github.com/ddiakopoulos/tinygizmo) and [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkooparse%2Fmogwai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkooparse%2Fmogwai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkooparse%2Fmogwai/lists"}