Skip to main content

Function: playTrajectory()

playTrajectory(options): Animation

Defined in: src/mobjects/molecular/MorphMolecule.ts:252

Create a MoleculeTrajectory animation that plays a molecule across an ordered list of frames (an MD trajectory).

Over alpha 0 to 1, the molecule moves from frame 0 through each frame in order, interpolating linearly between consecutive frames and rebuilding the bonds each frame so the sticks follow the atoms. Pair it with parsePdbTrajectory to play a multi-MODEL PDB.

Parameters​

options​

PlayTrajectoryOptions

The molecule, the trajectory frames and the run time.

Returns​

Animation

An Animation to pass to scene.play.

Throws​

If frames is empty, or if any frame has the wrong length or a non-finite coordinate.