def track(self, delta_pixels, push_target=False, adj_fov=False):
        """
        This causes the camera to translate forward into the scene.
        This is also called "dollying" or "tracking" in some software packages.
        Passing in a negative delta causes the opposite motion.

        If ``push_target'' is True, the point of interest translates forward
        (or backward) *with* the camera, i.e. it's "pushed" along with the
        camera; otherwise it remains stationary.

        if ``adj_fov`` is True then the camera's FOV is adjusted to keep the
        target at the same size as before (so called "dolly zoom" or
        "trombone effect").
        """
        direction = self.target - self.position
        distance_from_target = direction.length()
        direction = direction.normalized()

        initial_ht = frustum_height_at_distance(self.fov_deg,
                                                distance_from_target)
        ## print("frustum height at distance %.4f is %.4f" % (
        ##     distance_from_target, initial_ht))

        speed_per_radius = self.get_translation_speed(distance_from_target)
        px_per_unit = self.vport_radius_px / speed_per_radius

        dolly_distance = delta_pixels / px_per_unit

        if not push_target:
            distance_from_target -= dolly_distance
            if distance_from_target < self.push_threshold * self.near_plane:
                distance_from_target = self.push_threshold * self.near_plane

        self.position += direction * dolly_distance
        self.target = self.position + direction * distance_from_target

        if adj_fov:
            # adjust FOV to match the size of the target before the dolly
            direction = self.target - self.position
            distance_from_target = direction.length()
            fov_deg = fov_for_height_and_distance(initial_ht,
                                                  distance_from_target)
            #print("fov is now %.4f" % fov_deg)
            self.fov_deg = fov_deg
def track ( self , delta_pixels , push_target = False , adj_fov = False ) : direction = self . target - self . position distance_from_target = direction . length ( ) direction = direction . normalized ( ) initial_ht = frustum_height_at_distance ( self . fov_deg , distance_from_target ) speed_per_radius = self . get_translation_speed ( distance_from_target ) px_per_unit = self . vport_radius_px / speed_per_radius dolly_distance = delta_pixels / px_per_unit if not push_target : distance_from_target -= dolly_distance if distance_from_target < self . push_threshold * self . near_plane : distance_from_target = self . push_threshold * self . near_plane self . position += direction * dolly_distance self . target = self . position + direction * distance_from_target if adj_fov : direction = self . target - self . position distance_from_target = direction . length ( ) fov_deg = fov_for_height_and_distance ( initial_ht , distance_from_target ) self . fov_deg = fov_deg
This causes the camera to translate forward into the scene.
        This is also called "dollying" or "tracking" in some software packages.
        Passing in a negative delta causes the opposite motion.

        If ``push_target'' is True, the point of interest translates forward
        (or backward) *with* the camera, i.e. it's "pushed" along with the
        camera; otherwise it remains stationary.

        if ``adj_fov`` is True then the camera's FOV is adjusted to keep the
        target at the same size as before (so called "dolly zoom" or
        "trombone effect").