hi everyone mehmed is here today i will
talk about animation on desmos
look at this now i am playing
mario on desmos you probably i want to
learn how i did it right
let's get started
[Music]
this is the fourth video of desmos art
video series if you're a beginner
and don't know about the functions a lot
i definitely recommend you to watch
the first three videos guys you can find
the links in description below
and then come back here continue
watching the fourth video
now let's go to desmos and start working
we will talk about the mario animation
but first let's talk about the basics
i will start with point animation um
here's a point a
when i write the coordinates it appears
here just like that
but if i want to animate the point i can
simply add a letter
to any of those values or for both
values
for example if i want to animate the
point horizontally i can add a slider
for the x coordinate
or if i want to do it vertically i can
do it for the y coordinate
let me add a slider for the x value and
you can click play
and you see guys it starts moving you
can also do some changes here
like changing the speed next let's talk
about animating lines
i have a line here y equals mx plus 5
and i'm adding a slider for the m
let's animate it so changing mv animates
the line
and give us lines with different slopes
we can also do some changes
for example we can change the animation
mode there are several options here
so basically animations are created by
sliders
you can also use one slider to animate
more things
let's say i have two lines here but i am
using the same variable
as you can see on both lines and
the slider moves both of them that's
great
of course we can write restrictions as
well i will talk about one more thing
piecewise functions they are super
important i have two equations here
right let's turn them into functions
and let's say the first one is f of x
and the second one is ufx
now i will use these two and create a
piecewise function
let's say m capital a of x piecewise
functions combines
different functions and make them one
single function
that's why they are super important and
these functions are written in this form
open the curly brackets write the
interval for the first function
and the column add the name of the
function you use
after you press comma you can start this
over and over again
just add as many functions as you want
now i have only two of them
so i will repeat this one for geofx as
well
i will stop here and close the brackets
and i have a piecewise function
a of x here let's hide f of x and g of x
here's my piecewise function now what i
will do is also really important
i am going to add a point on a of x here
is a point p
and if i want this point to appear on
the function
i need to add a variable for the x
coordinate and then i am going to
write the y coordinates in the form of
the function
a of x you see the point
appears on the function we can move it
manually just like that
let's change the starting and end values
done you can also hide af x and only see
the point
like advancing ball effects we can also
animate polygons
we can create polygons from table
volumes let me quickly add some volumes
here
we haven't talked about polygons before
polygons are really easy to use easy to
create
for example here's my table values and i
am going to
use the polygon tool to create a
triangle just write polygon
open the brackets just check the table
values
the name of the table values you have
for x coordinate it says x sub 1
for y coordinates it says y sub 1 and
yeah
it gives me a triangle and adding more
volumes to the table guys
will increase the number of sides this
is the polygon tool it's really useful
guys you can use it for your projects
and let's say i want to animate the
pentagon here
add a variable in a table and move the
slider
you can use the same slider or different
variables
for other points
we can also animate curves or even areas
just like that okay now it's time to
talk about the big project
mario animation first of all i
downloaded some pictures
let's add them um foldering is super
important
so i will create the pictures folder
first let's add pictures here
one for background i will change the
opacity
it's good and i need a ground here as
well because i want it to be
completely visible we can easily move or
resize pictures
and i'm gonna add two clouds
and this is today's star mario and we
have two troops
and don't forget his enemies right we
have two
deadly piranha plants here i told you
before guys order is important in desmos
so plants needs to be behind the tubes
so let's move the plants up and here's
the plan
mario will move like that plants will
move up and down
and the clouds will move right and left
okay
let's create the function folder and
start writing functions
first i'm going to start with the
mario's path mario first moves forward
and we need something like um the center
of the mario to move right so it's it's
about y equals 1.2 and of course i will
write it as a function
so a of x equals 1.2 then we need a
parabola which opens down
so it has a negative leading coefficient
the vertex something like
2 and 4 a vertex form is super useful on
desmos guys
i will duplicate this and transform a
little bit to the right
for the next function okay i need two
more
for the other tube and i am transforming
the same function
two more times
and done now i will use these functions
and the intersection points they are
super important
to create my piecewise function let's
name it
i'm gonna name capital a of x and start
writing you just need to check the
intersection points
and write the intervals and remember
guys in piecewise functions
you need to write first interval column
the name of the function and then you
will add comma
and continue writing other functions as
many functions as you want
just like that i use a of x
first then b of x then c of x
and then one more time of x because it
will continue to go
forward at that part and then d of x f
of x
and then finally a of x one more time um
by the way
we cannot create lowercase e of x
because
e is also used as earlier number so i
skip that
let's hide all those and here's my
pre-spikes function
now i need to put mario there first i
need a point on the function
we just did couple of minutes ago guys
the same idea a variable
than the y value let me set
the max and mean values for the interval
great
now let's go to the mario's picture and
place
this point as the center of the picture
i am pasting the point here done
let's see
okay it worked great i am going to put
this animation at the top
because this is the important one
now let's do something similar for other
objects
these plants need to move up and down so
the center x value needs to stay the
same
and y value needs to be the variable
it will make the horizontal move the
center coordinates are
x equals 3 and y equals 3.74 so i
need to write a point let's say point q
as
3 for x and the variable for y let's say
n
also the other plants has a center at x
equals 10.95
so i will also write another point let's
take point r
for the other plant and i will keep the
same variable because i want them
moved together so when i press play guys
look how the points move
that's great
um let's place these points at the
center of the plants
um three three n for the first one
and 10.95 and for the second one done
let's hide the points and animate it
it looks really good finally the clouds
i will keep their y values same and add
sliders for x values
i will not add the same variable because
i want to move separately
let's do this quickly
now everything is working i will keep
these animations running
if you don't stop them guys keep them
running even if you send this link to
someone right it will animate as soon as
they open the link
um the only thing i want to animate by
myself is the mario
and here's the play button at the top so
you can just close all the folders
and share it with your friends just like
that
let's start it is good right
you can also add effects like a game
over when the mario hits the plans
but it's it's the topic for another
video right
okay guys it is done what do you think
about our mario animation did you like
it
i hope you do and if you do don't forget
to hit the like button
and we are very close to 10 000
subscribers guys
you can help us by subscribing this
channel
i will continue recording more videos
about desmos if you have any questions
just leave a comment below and let me
know i will answer your questions as
early as possible
so see you next time goodbye
you