View source: R/diameter_model.R
diameter_model | R Documentation |
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" )
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. |
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
.
List object containing the input parameters and a model with the resulting diameter for each frame in the animation.
Nicholas Carey - nicholascarey@gmail.com
looming_animation
,
looming_animation_calib
, variable_speed_model
constant_speed_model
,
loom_model <- diameter_model( start_diameter = 2, end_diameter = 50, duration = 3, frame_rate = 60, expansion = "constant_speed")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.