pub fn new_from_vector(pos: Point3f, look: Vector3f, aspect_ratio: f32) -> Self {
        let mut look_phi = ((look.x) / ((look.x * look.x + look.y * look.y).sqrt())).acos();
        if look.y < 0.0 {
            look_phi = 2.0 * consts::PI - look_phi;
        }

        let look_theta =
            (consts::PI / 2.0) - ((look.z) / ((look.x * look.x + look.y * look.y).sqrt())).atan();

        Camera {
            position: pos,
            phi: look_phi,
            theta: look_theta,
            aspect_ratio: aspect_ratio,
            proj: perspective(deg(60.0), aspect_ratio, 0.1, 3_000.0),
        }
    }
/// returns a camera based on a vector to look at
returns a camera based on a vector to look at
returns a camera based on a vector to look at
pub fn new_from_vector(pos: Point3f, look: Vector3f, aspect_ratio: f32) -> Self {
        let mut look_phi = ((look.x) / ((look.x * look.x + look.y * look.y).sqrt())).acos();
        if look.y < 0.0 {
            look_phi = 2.0 * consts::PI - look_phi;
        }
        let look_theta =
            (consts::PI / 2.0) - ((look.z) / ((look.x * look.x + look.y * look.y).sqrt())).atan();
        Camera {
            position: pos,
            phi: look_phi,
            theta: look_theta,
            aspect_ratio: aspect_ratio,
            proj: perspective(deg(60.0), aspect_ratio, 0.1, 3_000.0),
        }
    }
pub fn new_from_vector ( pos : Point3f , look : Vector3f , aspect_ratio : f32 ) -> Self { let mut look_phi = ( ( look . x ) / ( ( look . x * look . x + look . y * look . y ) . sqrt ( ) ) ) . acos ( ) ; if look . y < 0.0 { look_phi = 2.0 * consts :: PI - look_phi ; } let look_theta = ( consts :: PI / 2.0 ) - ( ( look . z ) / ( ( look . x * look . x + look . y * look . y ) . sqrt ( ) ) ) . atan ( ) ; Camera { position : pos , phi : look_phi , theta : look_theta , aspect_ratio : aspect_ratio , proj : perspective ( deg ( 60.0 ) , aspect_ratio , 0.1 , 3_000.0 ) , } }
returns a camera based on a vector to look at
returns a camera based on a vector to look at
pos
Point3f
look
Vector3f
aspect_ratio
f32