def vanishing_point_to_vector(photo, v): """ Return the 3D vector corresponding to a vanishing point (specified in normalized coordinates) """ return normalized(( (v[0] - 0.5) * photo.aspect_ratio, 0.5 - v[1], # flip y coordinate -photo.focal_y))
def vanishing_point_to_vector(photo, v): """ Return the 3D vector corresponding to a vanishing point (specified in normalized coordinates) """ return normalized(( (v[0] - 0.5) * photo.aspect_ratio, 0.5 - v[1], # flip y coordinate -photo.focal_y ))
def vanishing_point_to_vector(self, v, focal_y=None): """ Return the 3D unit vector corresponding to a vanishing point (specified in normalized coordinates) """ if not focal_y: focal_y = self.focal_y return normalized(( (v[0] - 0.5) * self.aspect_ratio, 0.5 - v[1], # flip y coordinate -focal_y))