Week 2: Developer journal


This week was looking at programmatic animation.

The basics of it programmatic animation is that animation is motion as such mathematical formulas can be applied to an objects position, to determine it’s next and affect the behaviour of it’s movement.

Animation doesn’t exclusively mean movement it can also be property animation which is for changes to any visual attributes of an object.

The core component to animation is time as without time it’s just a still image also this is why without animation there seems to be no sense of time even if time is present.

Nearly every form of projected media use frames to accomplish the illusion of motion. Frames are a series of images where when shown in rapid succession simulate motion or changes to an object.

Frames Per Second (FPS) is the amount of frames shown per second and depending on the medium being used affects what people perceive as acceptable for quality.
For films a rate of 24 FPS people will accept as a single moving image.
For games 60 FPS is the general desirable benchmark this is as higher frame rates in programmed animation can result in more responsive interaction therefore feeling smoother.

An advantage to programming an animation is that it’s dynamic as instead of just watching a predetermined sequence of frames you can generate new images creating a unique visual experience for each viewing.

For example if you calculate an object’s position using user-provided values the media can responsively update the display to interact with the user, creating a level of immersion not capable with other media types.

Triangle sides:
Sine – The ratio of the lengths of the opposite and hypotenuse sides. The sine of an angle is the opposite divided by the hypotenuse.
Cosine – The ratio of the lengths of the adjacent and hypotenuse sides. The cosine of an angle is adjacent divided by the hypotenuse.
Sine and Cosine – If the hypotenuse of a right-angled triangle is 1 it can be discarded from the equation and resolve height and width with the sine and cosine of the angle.

Lesser used Trig functions in animations:
Tangent – The relationship of the opposite leg to the adjacent leg.
Arcsine – The reverse of sin – it takes the ration of opposite divided by hypotenuse and returns the angle.
Arccosine – The reverse of cos – takes the ratio of adjacent divided by hypotenuse and returns the angle.

Arctangent – This function is important as it takes 2 values the measurement of the opposite side and adjacent side. This measurement is the position of an x and y coordinate. This commonly is used for finding the angle towards an object at a given position.

Vectors – A construct that represents both a direction as well as a magnitude.
For velocity the magnitude is the speed.
Magnitude is always positive.

Velocity – Moving along 2 axes is simple as it’s just defining an x and y velocity which are added to the x and y property of the object on each frame.

Angular velocity – Where using the angle of a velocity and its magnitude you can apply it to a point using Trigonometry.

Acceleration – Described as a value and direction however while velocity changes the position of an object acceleration changes the velocity.

Gravity – The attraction between 2 bodies where the distance and angle between them must be taken into account to figure the actual acceleration on each body. Simply defines a set value on a single axis.

Angular acceleration – Can use the same principle as with velocity where it is based on a nominal force.

Linear Interpolation – Often called LERP is a way to establish an intermediary value between a start and end value.

Easing – Modifying the position of an object based on the remaining distance between it and a target multiplied by a factor less than 1 (0-1).