rerun-io / rerun

Visualize streams of multimodal data. Free, fast, easy to use, and simple to integrate. Built in Rust.
https://rerun.io/
Apache License 2.0
6.55k stars 333 forks source link

Pinhole component: a union of different representations #2653

Open emilk opened 1 year ago

emilk commented 1 year ago

log_pinhole takes a focal_length_px argument and then directly converts it into a 3x3 matrix. Instead we should rewrite the Pinhole component as something similar to:

enum Pinhole {
    Matrix(PinholeMatrix),
    Params(PinholeParams)
}

struct PinholeMatrix {
    pub size: Vec2,

    pub child_from_parent: Mat3
}

struct PinholeParams {
    pub size: Vec2,

    pub focal_length_px: Vec2,

    /// Default: center
    pub principal_point_px: Option<Vec2>,
}
emilk commented 3 months ago

So we need some other design for this