neu_draw.orbit

Camera orbits: the angle schedule and the pose at each angle. Pure numpy.

An orbit rotates the camera, never the data, about the point at the centre of the screen at the depth of the scene’s centre, so frame 0 is the current view. The axis is either a screen axis (up, right, view, read from the camera as the orbit starts, so up is a turntable of the current view) or a data axis (x, y, z or an xyz vector, in nm). Either way the camera turns about a world-space axis.

An orbit is a schedule of angles, not an interpolation between orientations, which would take the short way round and make 360° a no-op. Positive degrees turn the camera by the right-hand rule, so the scene appears to turn the other way.

Attributes

Functions

angles(degrees, frames, *[, ease]) → numpy.ndarray

The camera angle at each frame, in radians, starting at 0.

axis_quaternion(axis, angle) → numpy.ndarray

The rotation by angle radians about the unit vector axis, xyzw.

pivot(position, rotation, centre) → numpy.ndarray

The point at the screen centre, at the depth of centre. Not centre itself,

pose(position, rotation, about, axis_world, angle) → tuple[numpy.ndarray, numpy.ndarray]

The camera (position, rotation) after turning angle about about.

world_axis(axis, camera_rotation) → numpy.ndarray

axis as a world direction. Checked eagerly, so a typo fails before frame 0.

Module Contents

neu_draw.orbit.angles(degrees: float, frames: int, *, ease: str = 'linear') → numpy.ndarray

The camera angle at each frame, in radians, starting at 0.

A whole number of turns omits the endpoint, so the video loops without a repeated frame; any other sweep ends exactly at degrees.

neu_draw.orbit.axis_quaternion(axis: Sequence[float], angle: float) → numpy.ndarray

The rotation by angle radians about the unit vector axis, xyzw.

neu_draw.orbit.pivot(position: Sequence[float], rotation: Sequence[float], centre: Sequence[float]) → numpy.ndarray

The point at the screen centre, at the depth of centre. Not centre itself, which after a pan is off to one side, so orbiting it would swing the view away.

neu_draw.orbit.pose(position: Sequence[float], rotation: Sequence[float], about: Sequence[float], axis_world: Sequence[float], angle: float) → tuple[numpy.ndarray, numpy.ndarray]

The camera (position, rotation) after turning angle about about.

neu_draw.orbit.world_axis(axis: Axis, camera_rotation: Sequence[float]) → numpy.ndarray

axis as a world direction. Checked eagerly, so a typo fails before frame 0.

neu_draw.orbit.Axis
neu_draw.orbit.DATA_AXES
neu_draw.orbit.EASES
neu_draw.orbit.SCREEN_AXES