{"id":13734495,"url":"https://github.com/strasdat/vviz","last_synced_at":"2025-04-14T08:34:46.818Z","repository":{"id":43751866,"uuid":"443187756","full_name":"strasdat/vviz","owner":"strasdat","description":"Rapid prototyping GUI, and visual printf-style debugging for computer vision development.","archived":false,"fork":false,"pushed_at":"2022-04-18T19:10:24.000Z","size":14123,"stargazers_count":24,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T22:07:13.233Z","etag":null,"topics":["2d","3d","computer-vision","graphics","gui","rust","vision"],"latest_commit_sha":null,"homepage":"https://strasdat.github.io/vviz/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strasdat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-30T21:24:32.000Z","updated_at":"2024-04-24T00:08:07.000Z","dependencies_parsed_at":"2022-08-30T19:21:14.753Z","dependency_job_id":null,"html_url":"https://github.com/strasdat/vviz","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strasdat%2Fvviz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strasdat%2Fvviz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strasdat%2Fvviz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strasdat%2Fvviz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strasdat","download_url":"https://codeload.github.com/strasdat/vviz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248305850,"owners_count":21081575,"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":["2d","3d","computer-vision","graphics","gui","rust","vision"],"created_at":"2024-08-03T03:00:56.491Z","updated_at":"2025-04-14T08:34:46.768Z","avatar_url":"https://github.com/strasdat.png","language":"Rust","funding_links":[],"categories":["Libraries"],"sub_categories":["Libraries: Other"],"readme":"# vviz\n[![Latest version](https://img.shields.io/crates/v/vviz.svg)](https://crates.io/crates/vviz)\n[![Documentation](https://docs.rs/vviz/badge.svg)](https://docs.rs/vviz)\n[![Continuous integration](https://github.com/strasdat/vviz/actions/workflows/ci.yml/badge.svg)](https://github.com/strasdat/vviz/actions/workflows/ci.yml)\n![MIT](https://img.shields.io/badge/license-MIT-blue.svg)\n![Apache](https://img.shields.io/badge/license-Apache-blue.svg)\n\nRapid prototyping GUI, and visual printf-style debugging for computer vision development.\n\nIts core dependencies are [egui](https://github.com/emilk/egui) and \n[Miniquad](https://github.com/not-fl3/miniquad). For a full list of dependencies, please inspect the\n[Cargo.toml](Cargo.toml) file.\n\n## Warning: Development halted\n\nThis project is currently parked - I do not plan to continue development in the short term. It is \nlikely I will continue in a year or three - especially if Rust adoption continues in similar rapid\nfashin.\n\nA few challenges I encountered with the current approach:\n\n - The wasm version proved to be more challenging than I estimated. Frameworks such as wasm-bindgen or\n   stdweb seem to be less main stream than I thought, and egui and miniquad rely in a custom WASM build \n   scripts - which makes it much harder to depend on other libraries for the wasm build.\n   https://github.com/not-fl3/macroquad/issues/212\n - Strangely, plotting point clouds seems a little tricky...\n   \n\n## Getting started\n\n### Placing a 3d entity in the main panel.\n\n\n```rust, no_run\n    vviz::app::spawn(vviz::app::VVizMode::Local, |mut manager: vviz::manager::Manager| {\n        let w3d = manager.add_widget3(\"w3d\".to_string());\n        w3d.place_entity_at(\n            \"cube\".to_string(),\n            vviz::entities::colored_cube(1.0),\n            vviz::math::rot_x(0.7),\n        );\n        loop {\n            manager.sync_with_gui();\n        }\n    });\n```\n\n![simple example image](https://media.giphy.com/media/EcUl5vMa7prRt8gO6I/giphy.gif)\n\n### Interacting with ranged values (sliders) and enums (combo boxes).\n\n\n```rust, no_run\n    #[derive(\n        Clone,\n        Debug,\n        PartialEq,\n        strum_macros::Display,\n        strum_macros::EnumString,\n        strum_macros::EnumVariantNames,\n    )]\n    enum Manipulation {\n        Position,\n        Orientation,\n    }\n\n    vviz::app::spawn(vviz::app::VVizMode::Local, |mut manager: vviz::manager::Manager| {\n        let w3d = manager.add_widget3(\"w3d\".to_string());\n\n        w3d.place_entity(\"cube\".to_string(), vviz::entities::colored_cube(1.0));\n        let mut scene_pose_entity = nalgebra::Isometry3::\u003cf32\u003e::identity();\n\n        let mut ui_delta = manager.add_ranged_value(\"delta\".to_string(), 0.0, (-1.0, 1.0));\n        let mut ui_dim = manager.add_ranged_value(\"dimension\".to_string(), 0, (0, 2));\n        let mut ui_manipulation =\n            manager.add_enum(\"manipulation\".to_string(), Manipulation::Position);\n\n        loop {\n            if ui_delta.get_new_value().is_some()\n                || ui_dim.get_new_value().is_some()\n                || ui_manipulation.get_new_value().is_some()\n            {\n                let delta = ui_delta.get_value();\n                let manipulation = ui_manipulation.get_value();\n                match manipulation {\n                    Manipulation::Position =\u003e {\n                        scene_pose_entity.translation.vector[ui_dim.get_value()] = delta;\n                    }\n                    Manipulation::Orientation =\u003e {\n                        let mut scaled_axis = nalgebra::Vector3::zeros();\n                        scaled_axis[ui_dim.get_value()] = delta;\n                        scene_pose_entity.rotation =\n                            nalgebra::UnitQuaternion::\u003cf32\u003e::from_scaled_axis(scaled_axis);\n                    }\n                }\n                w3d.update_scene_pose_entity(\"cube\".to_string(), scene_pose_entity)\n            }\n            manager.sync_with_gui();\n        }\n    });\n```\n\n![interaction example gif](https://media.giphy.com/media/0tIFBhoJepwm8MmsV1/giphy.gif)\n\n\n### Multiple widgets\n\n\n```rust, no_run\n    vviz::app::spawn(vviz::app::VVizMode::Local, |mut manager: vviz::manager::Manager| {\n        let w3d = manager.add_widget3(\"w3d\".to_string());\n        w3d.place_entity_at(\n            \"cube\".to_string(),\n            vviz::entities::colored_cube(0.5),\n            nalgebra::Isometry3::\u003cf32\u003e::translation(0.0, 0.75, 0.0),\n        );\n        w3d.place_entity_at(\n            \"cube2\".to_string(),\n            vviz::entities::colored_cube(0.5),\n            nalgebra::Isometry3::\u003cf32\u003e::translation(0.0, -0.75, 0.0),\n        );\n\n        let w2 = manager.add_widget3(\"w2\".to_string());\n        let triangles = vec![vviz::entities::ColoredTriangle {\n            face: [[2.0, -2.0, 0.0], [2.0, 1.0, 0.0], [0.0, 1.0, 0.0]],\n            color: vviz::entities::Color {\n                r: 1.0,\n                g: 0.0,\n                b: 0.0,\n                alpha: 1.0,\n            },\n        }];\n        w2.place_entity(\n            \"triangles\".to_string(),\n            vviz::entities::colored_triangles(triangles),\n        );\n        let _w3 = manager.add_widget3(\"empty\".to_string());\n\n        let mut ui_a_button = manager.add_button(\"a button\".to_string());\n        loop {\n            if ui_a_button.was_pressed() {\n                println!(\"a button pressed\");\n            }\n            manager.sync_with_gui();\n        }\n    });\n```\n\n![multi-widget example gif](https://media.giphy.com/media/DHM12WLKEmh1N7bUGT/giphy.gif)\n\n### 2d widgets - to show an image\n\n```rust, no_run\n    vviz::app::spawn(vviz::app::VVizMode::Local, |mut manager: vviz::manager::Manager| {\n        let image: image::DynamicImage = vviz::utilities::load_image_from_url(\n            \"https://rustacean.net/assets/rustacean-orig-noshadow.png\",\n        )\n        .unwrap();\n        manager.add_widget2(\"img\".to_string(), image.into_rgba8());\n        manager.sync_with_gui();\n    });\n    \n```\n\n![widget2 gif](https://media.giphy.com/media/MlPcFqkBh7zhVdlQT2/giphy.gif)\n\n```rust, no_run\n    vviz::app::spawn(vviz::app::VVizMode::Local, |mut manager: vviz::manager::Manager| {\n        let w3d = manager.add_widget3(\"w3d\".to_string());\n        w3d.place_entity_at(\n            \"axis\".to_string(),\n            vviz::entities::Axis3::from_scale(1.0).into(),\n            vviz::math::rot_x(0.7),\n        );\n\n        w3d.place_entity_at(\n            \"points\".to_string(),\n            vviz::entities::ColoredPoints3::from_arrays_and_color(\n                vec![\n                    [0.50, 0.50, 0.5],\n                    [0.25, 0.50, 0.5],\n                    [0.50, 0.25, 0.5],\n                    [0.25, 0.25, 0.5],\n                ],\n                vviz::entities::Color {\n                    r: 1.0,\n                    g: 0.0,\n                    b: 0.0,\n                    alpha: 1.0,\n                },\n            )\n            .into(),\n            vviz::math::rot_x(0.7),\n        );\n        loop {\n            manager.sync_with_gui();\n        }\n    });\n    \n```\n\n### Lines and points\n\n![lines and points gif](https://media.giphy.com/media/AtBtWE7U49UKVRlQcA/giphy.gif)\n\n## Goals\n - Enabling 2d and 3d visualization for computer vision development\n - Visual \"printf-style\" debugging\n - User interaction by binding UI components (slider, checkbox, ...) to  primitive types (f32, bool, \n   ...). \n - Minimal API surface - users are interacting with vviz through a small set of functions and \n   structs.\n - Remote visualization\n - Targeting desktop app and browser app (in v0.6.0)\n\n## Non-goals\n - Full fledged GUI framework\n - Aesthetics customization - e.g. precisely define location / shape of button, slider etc.\n - Commitment to egui / miniquad for backend. The GUI and 3d rendering backend might be replaced\n   before version 1.0.0 is reached.\n - Stable API before version 1.0.0.\n   \n\n## Roadmap\n\n - 0.1: MVP\n   - [x] components: slider, button, checkbox, combobox\n   - [x] multiple widgets for 3d rendering\n   - [x] CI on github\n   - [x] create examples folder\n   - [x] README and code comments\n - 0.2: Widget2 and Widget3 additions\n   - [x] Widget2: to display image\n   - [x] Widget3: add basic 3d orbital control\n   - [x] Widget3: line segments and points\n   - [x] start vviz book\n - **0.3: remote visualization**\n   - [x] remote vviz::Manger with websocket server\n   - [x] remote visualization client\n - 0.4: 2d overlays, improved controls \u0026 widget3 features\n   - [ ] custom projective view given pinhole camera\n   - [ ] 2d rendering\n   - [ ] 2d image control\n   - [ ] improved orbital control, using depth buffers\n   - [ ] textured mesh\n   - [ ] 3d phong shading option\n - 0.5: graph plotting using PlotWidget\n - 0.6: web visualization, in addition to desktop lib\n   - [ ] wasm app: vviz::Gui in browser using websocket client\n\n## Acknowledgements\n\nvviz is influenced by other open source projects, especially \n[Pangolin](https://github.com/stevenlovegrove/pangolin).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrasdat%2Fvviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrasdat%2Fvviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrasdat%2Fvviz/lists"}