pub fn world_to_ndc(&self, world_position: Vec3) -> Option<Vec3> {
        // Build a transform to convert from world to NDC using camera data
        let world_to_ndc: Mat4 = self.proj * self.transform.compute_matrix().inverse();
        let ndc_space_coords: Vec3 = world_to_ndc.project_point3(world_position);

        if !ndc_space_coords.is_nan() {
            Some(ndc_space_coords)
        } else {
            None
        }
    }
/// Given a position in world space, use the camera to compute the Normalized Device Coordinates.
///
/// Values returned will be between -1.0 and 1.0 when the position is in screen space.
/// To get the coordinates in the render target dimensions, you should use
/// [`world_to_screen`](Self::world_to_screen).
Given a position in world space, use the camera to compute the Normalized Device Coordinates.
Values returned will be between -1.0 and 1.0 when the position is in screen space.
To get the coordinates in the render target dimensions, you should use
[`world_to_screen`](Self::world_to_screen).
Given a position in world space use the camera to compute the Normalized Device Coordinates . Values returned will be between - 1 . 0 and 1 . 0 when the position is in screen space . To get the coordinates in the render target dimensions you should use [ ` world_to_screen ` ] ( Self :: world_to_screen ) .
pub fn world_to_ndc(&self, world_position: Vec3) -> Option<Vec3> {
        // Build a transform to convert from world to NDC using camera data
        let world_to_ndc: Mat4 = self.proj * self.transform.compute_matrix().inverse();
        let ndc_space_coords: Vec3 = world_to_ndc.project_point3(world_position);
        if !ndc_space_coords.is_nan() {
            Some(ndc_space_coords)
        } else {
            None
        }
    }
pub fn world_to_ndc ( & self , world_position : Vec3 ) -> Option < Vec3 > { // Build a transform to convert from world to NDC using camera data let world_to_ndc : Mat4 = self . proj * self . transform . compute_matrix ( ) . inverse ( ) ; let ndc_space_coords : Vec3 = world_to_ndc . project_point3 ( world_position ) ; if ! ndc_space_coords . is_nan ( ) { Some ( ndc_space_coords ) } else { None } }
Given a position in world space, use the camera to compute the Normalized Device Coordinates.
Given a position in world space use the camera to compute the Normalized Device Coordinates .
&self
world_position
Vec3
&self
world_position
Vec3