pub struct Projection { /* private fields */ }Expand description
Camera projection from Linkage Blaze world coordinates to pixel coordinates.
The rotation maps world axes onto camera axes: row 0 is depth, row 1 is the source of screen X, and row 2 is the source of screen Y. Named constructors provide orthographic front/top views and a perspective front view.
Use front_orthographic for a stable front
camera, top_orthographic for a top camera, or
front_perspective when depth should affect
scale. Item3d::project and crate::Pose::project consume the result.
Implementations§
Source§impl Projection
impl Projection
Sourcepub const fn front_orthographic(target_origin: Point, scale: f32) -> Self
pub const fn front_orthographic(target_origin: Point, scale: f32) -> Self
Create an orthographic front view looking along negative X. See the rendering evaluated items example.
Sourcepub const fn top_orthographic(target_origin: Point, scale: f32) -> Self
pub const fn top_orthographic(target_origin: Point, scale: f32) -> Self
Create an orthographic top view looking along negative Z. See the rendering evaluated items example.
Sourcepub const fn front_perspective(
target_origin: Point,
scale: f32,
focal: f32,
) -> Self
pub const fn front_perspective( target_origin: Point, scale: f32, focal: f32, ) -> Self
Create a perspective front view looking along negative X. See the rendering evaluated items example.
Sourcepub fn project_dir(
&self,
pose: Pose,
world_dir: Vec3,
radius: f32,
) -> (f32, f32)
pub fn project_dir( &self, pose: Pose, world_dir: Vec3, radius: f32, ) -> (f32, f32)
Project a world-space direction, scaled by a world-space radius. See the rendering evaluated items example.
Sourcepub fn project_radius(&self, pose: Pose, radius: f32) -> f32
pub fn project_radius(&self, pose: Pose, radius: f32) -> f32
Convert a world-space sphere radius to pixels at a pose’s depth. See the rendering evaluated items example.
Sourcepub fn project_width(&self, width: f32) -> f32
pub fn project_width(&self, width: f32) -> f32
Convert a world-space stroke width to pixels. See the rendering evaluated items example.