Creates a simple model for making a looming animation by setting start and end screen diameters and total duration

diameter_model(
  start_diameter = 3,
  end_diameter = 50,
  duration = 3,
  frame_rate = 60,
  expansion = "constant_speed"
)

Arguments

start_diameter

numeric. Diameter (cm) you want the animation to start at.

end_diameter

numeric. Diameter (cm) you want the animation to end at. If you want the animation to fill the screen, this should be slightly larger than the physical screen size.

duration

numeric. Total duration (s) you want the animation to be.

frame_rate

numeric. Frames per second (Hz) you want the resulting animation to be played at.

expansion

string. constant_speed or constant_diameter. Sets if the expansion of the simulation is modelled as a constant speed or constant increase in diameter (see Details).

Value

List object containing the input parameters and a model with the resulting diameter for each frame in the animation.

Details

Creates a simple expansion model for use in looming_animation, from a start and end diameter, and a total duration. Expansion of the simulation can be set in two ways. In the default, constant_speed, the function models the expansion of the simulated oncoming object as if it were approaching at a constant speed. Because of visual foreshortening, this results in a simulation that expands progressively more rapidly as the animation progresses. If = constant_diameter, the function instead imposes a constant increase in diameter, i.e. a simulation that expands by the same amount in diameter in each frame. This simulation represents an oncoming object that is starting off at high speed, but slowing down as it gets closer to the target.

Inputs should be in cm, duration in seconds (s), and frame rate in Hz or Frames per Second.

Author

Nicholas Carey - nicholascarey@gmail.com

Examples

loom_model <- diameter_model(
                     start_diameter = 2,
                     end_diameter = 50,
                     duration = 3,
                     frame_rate = 60,
                     expansion = "constant_speed")