If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

# 4. Functions

## Video transcript

all right you finally have a snow man to start working with now we can get to the real guts of the rigging software we need to define our scale rotate and translate deformers to allow you to move your shapes around and this is where functions come into play remember functions package a series of operations or procedures will use many times functions except inputs which they perform a set of operations on now to build any de forma we'll need a function which susceptance the same us except a pair of coordinates which is a vertex in our shape and they set to value which is a magnitude of transformation you want to apply for example the translate x2 former might accept a coordinate 2 comma 2 and for the second input would provide a value of say 5 inside this translate X function the math we'll do is quite simple it adds 5 to the x-coordinate which updates it to 7 comma 2 and that's the process for transforming each vertex in the shape of course our shapes contain many vertices for example a hat has 8 and that means this function is run eight times once for each vertex all of the de forma functions transform vertices using equations and the transformation depends on the types of equations used in your functions the equations used for scaling rotate and translation are all different from each other we cover these equations in detail in our sets and staging lesson in the next code review we'll give you an example of writing a translation function and then in the exercise will allow you to write free to formal functions on your own alright I'm out of here