Model.move_clipping_sphere_to_XYZ_and_fit#

Model.move_clipping_sphere_to_XYZ_and_fit(x_center, y_center, z_center, radius, n_animation)#

Re-centers the view around a specified point, zooms in or out to fit a specified radius around that point, and does all of this in a specified number of frames of animation rather than instantly.

Parameters:
  • x_center (double) – The x-coordinate of the point.

  • y_center (double) – The y-coordinate of the point.

  • z_center (double) – The z-coordinate of the point.

  • radius (double) – The radius of the sphere.

  • n_animation (int) – Number of frames.

Example#

Pan the viewpoint to center on a point with coordinates (22.0, 17.5, 93.0) in 90 frames of animation, and zoom to display everything within 25.0 units of that point#
import hm
import hm.entities as ent

model = hm.Model()

model.move_clipping_sphere_to_XYZ_and_fit(
    x_center=22.0, y_center=17.5, z_center=93, radius=25.0, n_animation=90
)

Note

Use frames of animation rather than an instantaneous re-center allows a sense of relative location between the initial view point and the new one.