diameter_model: Diameter Model

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/diameter_model.R

Description

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

Usage

1
2
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).

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.

Value

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

Author(s)

Nicholas Carey - [email protected]

See Also

looming_animation, looming_animation_calib, variable_speed_model constant_speed_model,

Examples

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

nicholascarey/loomeR documentation built on July 15, 2019, 7:54 a.m.