Vviz - Rapid prototyping GUI, and visual printf-style debugging for computer vision development.

Overview

vviz

Latest version Documentation Continuous integration MIT Apache

Rapid prototyping GUI, and visual printf-style debugging for computer vision development.

Its core dependencies are egui and Miniquad. For a full list of dependencies, please inspect the Cargo.toml file.

Getting started

Placing a 3d entity in the main panel.

    vviz::app::spawn(|mut manager: vviz::manager::Manager| {
        let w3d = manager.add_widget3("w3d".to_string());
        w3d.place_entity_at(
            "cube".to_string(),
            vviz::entities::colored_cube(1.0),
            vviz::math::rot_x(0.7),
        );
        loop {
            manager.sync_with_gui();
        }
    });

simple example image

Interacting with ranged values (sliders) and enums (combo boxes).

    #[derive(
        Clone,
        Debug,
        PartialEq,
        strum_macros::Display,
        strum_macros::EnumString,
        strum_macros::EnumVariantNames,
    )]
    enum Manipulation {
        Position,
        Orientation,
    }

    vviz::app::spawn(|mut manager: vviz::manager::Manager| {
        let w3d = manager.add_widget3("w3d".to_string());

        w3d.place_entity("cube".to_string(), vviz::entities::colored_cube(1.0));
        let mut scene_pose_entity = nalgebra::Isometry3::<f32>::identity();

        let mut ui_delta = manager.add_ranged_value("delta".to_string(), 0.0, (-1.0, 1.0));
        let mut ui_dim = manager.add_ranged_value("dimension".to_string(), 0, (0, 2));
        let mut ui_manipulation =
            manager.add_enum("manipulation".to_string(), Manipulation::Position);

        loop {
            if ui_delta.get_new_value().is_some()
                || ui_dim.get_new_value().is_some()
                || ui_manipulation.get_new_value().is_some()
            {
                let delta = ui_delta.get_value();
                let manipulation = ui_manipulation.get_value();
                match manipulation {
                    Manipulation::Position => {
                        scene_pose_entity.translation.vector[ui_dim.get_value()] = delta;
                    }
                    Manipulation::Orientation => {
                        let mut scaled_axis = nalgebra::Vector3::zeros();
                        scaled_axis[ui_dim.get_value()] = delta;
                        scene_pose_entity.rotation =
                            nalgebra::UnitQuaternion::<f32>::from_scaled_axis(scaled_axis);
                    }
                }
                w3d.update_scene_pose_entity("cube".to_string(), scene_pose_entity)
            }
            manager.sync_with_gui();
        }
    });

interaction example gif

Multiple widgets

    vviz::app::spawn(|mut manager: vviz::manager::Manager| {
        let w3d = manager.add_widget3("w3d".to_string());
        w3d.place_entity_at(
            "cube".to_string(),
            vviz::entities::colored_cube(0.5),
            nalgebra::Isometry3::<f32>::translation(0.0, 0.75, 0.0),
        );
        w3d.place_entity_at(
            "cube2".to_string(),
            vviz::entities::colored_cube(0.5),
            nalgebra::Isometry3::<f32>::translation(0.0, -0.75, 0.0),
        );

        let w2 = manager.add_widget3("w2".to_string());
        let triangles = vec![vviz::entities::ColoredTriangle {
            face: [[2.0, -2.0, 0.0], [2.0, 1.0, 0.0], [0.0, 1.0, 0.0]],
            color: vviz::entities::Color {
                r: 1.0,
                g: 0.0,
                b: 0.0,
                alpha: 1.0,
            },
        }];
        w2.place_entity(
            "triangles".to_string(),
            vviz::entities::colored_triangles(triangles),
        );
        let _w3 = manager.add_widget3("empty".to_string());

        let mut ui_a_button = manager.add_button("a button".to_string());
        loop {
            if ui_a_button.was_pressed() {
                println!("a button pressed");
            }
            manager.sync_with_gui();
        }
    });

multi-widget example gif

2d widgets - to show an image

    vviz::app::spawn(|mut manager: vviz::manager::Manager| {
        let image: image::DynamicImage = vviz::utilities::load_image_from_url(
            "https://rustacean.net/assets/rustacean-orig-noshadow.png",
        )
        .unwrap();
        manager.add_widget2("img".to_string(), image);
        manager.sync_with_gui();
    });

Roadmap

  • 0.1: MVP
    • components: slider, button, checkbox, combobox
    • multiple widgets for 3d rendering
    • CI on github
    • create examples folder
    • README and code comments
  • 0.2: Widget2 and Widget3 additions
    • Widget2: to display image
    • Widget3: add basic 3d orbital control
    • Widget3: line segments and points
    • start vviz book
  • 0.3: 2d overlays, improved controls
    • custom projective view given pinhole camera
    • 2d rendering
    • 2d image control
    • improved orbital control, using depth buffers
    • 3d phong shading option
  • 0.4: graph plotting using PlotWidget
  • 0.5: web/remote visualization, in addition to standalone lib
    • lib: vviz::Manger with websocket server
    • wasm app: vviz::Gui in browser using websocket client

Acknowledgements

vviz is influenced by other open source projects, especially Pangolin.

You might also like...
Rust bindings for the FLTK GUI library.
Rust bindings for the FLTK GUI library.

fltk-rs Rust bindings for the FLTK Graphical User Interface library. The FLTK crate is a crossplatform lightweight gui library which can be statically

Idiomatic, GTK+-based, GUI library, inspired by Elm, written in Rust
Idiomatic, GTK+-based, GUI library, inspired by Elm, written in Rust

Relm Asynchronous, GTK+-based, GUI library, inspired by Elm, written in Rust. This library is in beta stage: it has not been thoroughly tested and its

Clear Coat is a Rust wrapper for the IUP GUI library.

Clear Coat Clear Coat is a Rust wrapper for the IUP GUI library. IUP uses native controls and has Windows and GTK backends. A macOS backend has been o

A single-header ANSI C immediate mode cross-platform GUI library
A single-header ANSI C immediate mode cross-platform GUI library

Nuklear This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed a

The bindings to the Nuklear 2D immediate GUI library.

nuklear-rust The bindings to the Nuklear 2D immediate GUI library. Currently beta. Drawing backends: gfx-pre-ll for GFX 3D drawing engine (examples: O

A cross-platform GUI library for Rust, inspired by Elm
A cross-platform GUI library for Rust, inspired by Elm

Iced A cross-platform GUI library for Rust focused on simplicity and type-safety. Inspired by Elm. Features Simple, easy-to-use, batteries-included AP

Truly cross platform, truly native. multiple backend GUI for rust
Truly cross platform, truly native. multiple backend GUI for rust

WIP: Sauron-native a rust UI library that conquers all platforms ranging from desktop to mobile devices. An attempt to create a truly native, truly cr

 A GUI for Cargo
A GUI for Cargo

A GUI for Cargo This is a project to make a GUI for cargo, built using SixtyFPS: The idea cargo install cargo-ui cargo ui Prerequisites In addition to

Automatically create GUI applications from clap3 apps
Automatically create GUI applications from clap3 apps

Automatically create GUI applications from clap3 apps

With Dejavu, you can have a perfect memory by capturing and organizing your visual recordings efficiently.

Dejavu The content in README.md is assisted by ChatGPT. Overview Dejavu is an open-source, cross-platform tool designed to help you record and search

Zhou Zhiqiang 127 Jul 31, 2023
This is a validator of Fitch style natural deduction proofs.

What is this? This is a formal proof validator, which assesses the correctness of Fitch-style natural deduction proofs ("Fitch proofs"). The tool also

null 3 Apr 10, 2024
A cross-platform GUI library for Rust focused on simplicity and type-safety

A cross-platform GUI library for Rust, inspired by Elm

Héctor Ramón 17.5k Jan 8, 2023
GUI based tool to sort and categorize images written in Rust

ImageSieve GUI based tool to sort out images based on similarity, categorize them according to their creation date and archive them in a target folder

Florian Fetz 67 Dec 14, 2022
An idiomatic GUI library inspired by Elm and based on gtk4-rs

An idiomatic GUI library inspired by Elm and based on gtk4-rs. Relm4 is a new version of relm that's built from scratch and is compatible with GTK4 an

Aaron Erhardt 722 Dec 31, 2022
A GUI for NordVPN on Linux that maintains feature parity with the official clients, written with Rust and GTK.

Viking for NordVPN This project aims to provide a fully usable and feature-complete graphical interface for NordVPN on Linux. While it attempts to clo

Jacob Birkett 2 Oct 23, 2022
Neovim GUI written in Rust, using relm4 and gtk4-rs

Reovim Neovim GUI written in Rust, using relm4 and gtk4-rs. Thanks Neovide Configuration To setup font add next line to init.vim set guifont=Cascadia\

songww 70 Dec 13, 2022
A simple, cross-platform GUI automation module for Rust.

AutoPilot AutoPilot is a Rust port of the Python C extension AutoPy, a simple, cross-platform GUI automation library for Python. For more information,

null 271 Dec 27, 2022
Desktop GUI Framework

Azul - Desktop GUI framework WARNING: The features advertised in this README may not work yet. Azul is a free, functional, immediate mode GUI framewor

Maps4Print 5.4k Jan 1, 2023
An easy-to-use, 2D GUI library written entirely in Rust.

Conrod An easy-to-use, 2D GUI library written entirely in Rust. Guide What is Conrod? A Brief Summary Screenshots and Videos Feature Overview Availabl

PistonDevelopers 3.3k Jan 1, 2023