[Music]
test one two check one two one two check
how is boxing
how is my audio how is my audio relative
to the music very I should be live in
just a minute
[Music]
you
[Music]
check one two testing the sound again
this time for real I think it's
everything is working alright here I am
here we go
[Music]
polar to Cartesian coordinates polar to
Cartesian coordinates all are to
Cartesian coordinates
hey welcome to oh no train was sold no
bail where did I put these things pickle
pickle I have a new sidekick you can't
see my sidekick I gotta get a sidekick
cam and this whole extra camera here
which will allow you to see my little
sidekick cam but oh wait where you going
pickle I don't know
wait a sec oh there we go excuse me
everybody hold on a sec
can we start can I start over let's
start over
we're gonna start over okay pickle all
right
we're putting on this music we are going
back to the opening screen and coming to
you live from Brooklyn New York
it is the coding train with your host me
Daniel
chief mod and it's coding buddy okay
welcome all right I'm back I'm
attempting to get back into live
streaming it's very hard for so many
different reasons and I know everybody
around the world is dealing with so many
different kinds of things and I hope
that me just being here you know
possibly once a week if I'm lucky maybe
even more making some coding tutorials
say hello bringing some sunshine and
cheer and ridiculously Wow the music is
actually quite excellent my
interpretation and maybe my use of the
music I could do a better job of but you
know here we are I've got a green screen
that's a little upgrade for today I've
got a one of these blue microphones
yep that's working I have a headset
which currently there's nothing going on
in here but if I had a producer they
could like tell me when I'm getting
things wrong like my physics formula is
off and my code is broken I could hear
them in my ear so you eventually could
talk to my ear if if things go well it's
4:00 p.m. Eastern time right now and we
can make it till you know 5:30 6 o'clock
an hour and a half or two hours towards
the end I might like to see if I can
answer some questions I got to introduce
you to pickle pickle pickle is sleeping
so calmly here on the floor I think it's
worth it here okay come on let's see Oh
all right what's this gonna do um here
where where are we gonna go here see
there we go hi pickle say hi oh yes he's
my little baby uh there she is oh girl
good girl yes we're going to do some
coding train together yes good girl good
girl good girl
okay okay putting this hook back
wherever I was supposed to be which is
here what's the chance this is in the
right spot um maybe this is where it's
supposed to be that's better
this is for my diagramming um and there
we go
erase here oh wait where what happened
to my sound board well the battery died
oh no but it's plugged in I should be
getting charged charged power Oh No oh
it says it's not plugged in but it is
plugged in
all right I have no soundboard right now
sorry that's really keeping me sane um I
lost my sound board Here I am oh wait
mark Rober is live streaming right now I
thought that was at four o'clock on a
Friday
mm-hmm yeah go watch mark Rober I'm just
here doing guys I'm not even like
sweating I've no idea what I'm doing
I'm gonna do a some coding tutorials I
think I mean I'm gonna be talking
hopefully more than just all right I
have another idea let's see if this
works
let's give me power come on sound board
you can do it well again this be cable
Oh which way do you go oh this way there
we go I've got power I've got power got
power okay all right okay pickle how
would do it there
I need another I definitely need another
webcam okay wrong one here we go all
right welcome to the coding train I and
Dan I am at home as almost all of us
around the world are I am in New York
City at particularly in Brooklyn which
is definitely a scary and place to be
these days and I hope that all my
neighbors are doing well I hope that
you're watching this are doing well and
I'm trying to get back into the rhythm
of doing work I teach classes of NYU
those classes are happening remotely my
kids are here being homeschooled I mean
they have some some video calls with
their teachers and classmates and work
being assigned to them but they need a
lot of help and supervision
so that takes up a lot of time and
energy you need to eat all the time
there's a lot of feeding going on
so my weeks are just kind of insane but
we're we're we're here we're happy we're
doing okay and I found that it's last
week I managed to finally sort of get
around to make trying to live stream it
was Saturday this week's a little bit
earlier it's Friday afternoon
who knows maybe next week I'll be back
to Thursday something a little bit
different I have never actually done
this and I'm not too happy about it
actually I might want to change is that
I'm sitting I might always stand when I
live stream i like to pace around move
around jump around uh just have that
energy of standing and it's kind of like
it lets me know that I am live-streaming
I am performing in a way for the live
stream and right now I'm sitting so I'm
not so sure about that a little bit I
also actually it's looking fine I have a
secondary light if you look at this
there's pretty there's like a pretty
decent shadow here I have a new light
which is coming from this side I have a
new polarizing filter on my camera which
I think is helping with the reflection
in my glasses
I really wanted to eliminate the
reflection in my glasses which I think
I've done a pretty decent job of I don't
know I can't actually tell what I'm
looking at you like yet see my monitor
over here but I do have another light
there's nothing this is the emperor's
new light here but this I have a light
that I could attach to here I was gonna
put it right here
and try to fill in the shadow but I'm
not gonna worry about that right now I
also need to figure out about recording
to disk so that if anything that I do
today has any value whatsoever that I
could
that I could do work with matsya who is
the editor for the coding train and put
together video that would get uploaded
separately afterwards for example I'd
like to try to do a coding challenge
today I have my white board over here
wait that's weird
am i smaller oh no no that's fine this
is what it should be
and then this just goes to the full
camera there we go
so there's so let me think about this
how am I going to work this myself no
it's charge ago it's charging charge on
up charge it up search it up people
alright watching from Iceland that is
amazing hello Iceland let's go to here I
I think we should do some wheel spinning
today
[Music]
I think we should just start with a
wheel spin whirly noise these are things
that are in the sort of pipeline
marching squares
what are some other like algorithms that
I have not programmed recently that
could be fun to do because I could just
pick between these two I should just do
whirly noise
it shouldn't let's take a look at the
[Music]
coding training suggested topics the
sitting thing is really weird I feel so
low energy we've got some new ones that
have been opened up recently two
dimensional discrete fourier transform
for images didn't I do that or maybe
this has to do with an image processing
on visualize common math algorithms take
u lated pi let's see let's look often I
assign them to myself when I feel like
it's something I'm going to do auto
encoder oak just do that that would be
fun do Bonacci spiral I think I have I
think I kind of did that already
I've done a lot of these these are the
open ones a lot of these have been done
these are the two that I was sort of
most recently thinking about looks you
were Lee knows as just let's forget
about that wheel spinning thing I'm
gonna get to I'm gonna get to the wheel
spinning Tetris let's just do let's do a
coding project that is like totally
manageable and look at these images it's
that I that is manageable that will give
me a pattern like this this might look
like a lot of these look like a Voronoi
tessellation which there's a whirly
noise which is a variation of which is a
kite
you know it's named for Steven whirly
but it's really cellular noise
which can be depending on how you
implement it you it's basically a you're
getting this burrowing tessellation
which is another coding challenge that I
should do but look at this one
interesting gizmos and games but but
there's a there's some ways to get some
interesting variety look at this I don't
actually know how to get it to look like
that that's interesting I know I feel
like this I've seen ooh look at this
these are interesting alright we're
gonna attempt to do this I'm just like
launching right into it I'm gonna open
up processing there's gonna be a test
now I need to record two discs so I'm
gonna press this button here
and I'm recording two discs I want to
attempt to also record I want to attempt
to also record the green screen
separately and the software that I do
that is um
here and I'm just give me a minute here
I didn't get a chance to do this in
advance I talk amongst yourselves um
let's see how do I create that virtual
oh let's just do is there audio coming
in no there might be though if I do this
audio audio audio audio audio no audio
sex there we go audio settings it's
getting some audio from interesting from
the camera itself I need to create a
virtual camera
I don't remember how to do new add input
I'll be back in a minute sorry I'm
setting up some good figure ancient
stuff so I could record this
green-skinned on its own which maybe is
not really gonna video browse blank
browse more more more virtual virtual
Virtual Set no that's interesting video
image camera virtual camera camera no
that's the one that I want desktop
capture virtual know what I want done
this before on my other streaming
computer this is fasiq go walk go watch
mark rubber stream come back in just
like five minutes tell me what's going
on in there
maybe I could do is there something that
he's teaching that I could do a coding
version of input virtual all right I got
to look this up people I'm looking up on
my v-max virtual camera is that not what
it's called I guess I could just try to
record this audio maybe I just need to
do I know of an idea add input settings
alright I think I might just have to
record an TSE 29 1929 97 that's right
audio recording
alright let's just hit record and see
what happens
audio mixer oh there we go inputs Game
Capture no no no I want to add an input
oh I know that's what I can do add an
input audio there we go
browse no no audio but not a file
don't be ridiculous what happens more
audio input there we go add device yes
the microphone is exactly what I want
ok yes there we go I've got my
microphone audio there we go now I'm
gonna do record oh oh it is
the monitor is on okay I'm on that's
okay I can just mute this do you hear
that weird echo you're gonna get
feedback too okay there we go that's
good now I'm gonna hit record and I put
one fine and before it's fine let's just
try that new file every let's say every
30 minutes and okay and am i recording
I'm recording okay I'm recording oh look
at me here okay alright
I have to livestream today I made it
like a last minute decision like I'm
just gonna do it just gonna livestream
today mark is doing a full-on physics
class on how to weigh stuff without
gravity complete with what I believe
will end up with differential equations
well I would say mark is doing an
excellent job without having watched it
probably well rehearsed prepare not just
like configuring settings on another
computer that's like over here I'm so
sorry everybody not going well whirly
noise tweaking of C points and colors
would be necessary to make this look
like stone oh let me I also need to
record separately a screen capture here
let's see how that works new screen
recording Oh record entire screen chord
ok so I think I'm recording now here I
want to get the paper out cellular
texture basis function 1996 and closest
point basis okay I think that's I think
I understand how this works
we all want you to make Tetris I just do
Tetris today it probably took I'm gonna
come back at you Tetris that'll be fun
just not today
who ain't open a window let's see how my
batteries are charging all right how's
everybody doing good
alright let's just give this a try no I
let's pick oh my goodness pickle pickle
is a little bit scared of my train
whistle it's gonna be ok pickle ok about
why you haven't made tetris yet it's an
excellent suggestion all right yes ok I
got it I got it
all right Tetris with whirly noise
instead of colors ok yes somebody's
knocking at my door waiting to beat my
microphone come on in what's going on I
am live streaming right now just so you
know
yeah you want me to view the microphone
hold on we've got it we've got a let's
let's move to let me do this and mute
the microphone
okay I'm back I don't know why my sound
word won't get any power should be
getting power we're getting started in
just a minute don't worry this is no
professional operation like the Mars
rover livestream just this is a very
unprofessional publication have I lost
all the viewers yet no I seem to be
gaining viewers understand how that's
possible
okay I doubt this is gonna get edited
into anything later but it's a good it's
a good good practice alright welcome to
a coding train coding challenge
[Music]
hi Bruno yeah I was gonna do
I sort of felt like I should do one of
these sir models which i think is
interesting to look at you know why how
how an infection spreads how social
distancing or physical distancing
whatever term you want to apply to that
can slow that spread and there's an
excellent visualization in The
Washington Post on that from several
weeks ago three blue one Brown did a
video Simon Tiger one of has done well
and I don't know I just I don't want to
do something that I really have no real
knowledge or expertise in I'm sure what
I have to add to that discussion so I
think I'm just gonna go with my usual
stuff but I will consider that
encouraging words all right here we go
hello and welcome to my first coding
challenge from home a new sort of studio
set up that I have looks kind of like
this I don't know how this is gonna go
I've got a green screen behind me I'm
sitting which is really kind of a
problem in terms of my I think I think
the Bloods not flowing to my brain
properly I should probably stand up but
what are you gonna do what are you gonna
do Here I am I'm going to attempt to
program whirly noise what is whirly
noise what's the algorithm for worldly
noise how can you program early noise
and can I get an image and I can't take
the point over there because I am have
this little tiny area for myself this is
not good I do not like this setup I
don't like this setup
I don't have a soundboard I made a
mistake should just take I should've
taken a nap I'm gonna go ahead and do
this anyway won't work try again this
this is a test Street this is not my
actual coding trade livestream move the
camera yeah hello and welcome to codec
challenge whirly noise I'm going to
attempt to program this algorithm that
is I found over here move the OBS camera
yeah yeah all right all right I promise
you that I'm gonna get used to this and
I'm gonna get the momentum going this is
your first time watching I'm very sorry
this is your second time watching if
there's any if you're watching I'm sorry
I I think I can I think I can manage to
bring myself to start to code an example
I just need to get over some sort of
like mental block what's happening to me
right now
[Music]
4:25 p.m. alright dad :
we didn't get a 1 million special I know
I know I'm having trouble I'm having
trouble welcome to a coding trained
coding challenge I have recording from a
new studio set up so things might be a
little wonky but I'm gonna try to make
this video I'm gonna try to program this
really noise thing I'm here in Brooklyn
New York at home with some lights and a
camera and a laptop and I'm sitting
which is really weird and I don't know
why I'm sitting but I should be standing
I like to stand while I code I'm sitting
everybody just take a deep breath with
me and let's try to make something fun
let's try to make something beautiful
I'm gonna make a very simple version of
just this algorithm and I don't think
it's gonna take that long and from there
maybe you can make your own creative
twist on it share it we can and that'll
be that that'll be something that's a
thing we could do to learn something to
enjoy ourselves and to be together
through this medium of the internet
video through a lens they know all right
I have to give up on this and I've got
to plug it in I've got to plug it in
over what cameras falling no no do you
hear a weird can I turn on slow mode not
easily right now
not easily I'm gonna plug this in over
here
really should charge this in advance
this is gonna make everything good okay
okay okay she's not used to being on my
alright okay ready okay okay okay here
we go
we try this one more time we're gonna
try this one more time it's nice that
everybody is always leaving me friendly
comments in the chat alright here we go
welcome to the first coding train coding
challenge from home gloria pickle and i
are really into this new algorithm
called whirly noise and she suggested it
I think so at least
no it was kind of pointed in the
direction of whirly noise when I was
looking at different web pages and I
thought let's program it as the first
coding challenge from home I've got a
new set up things are probably gonna be
a little bit wonky I'm just gonna I'm
just gonna do my best honestly like if
I'm recording this during a live stream
I don't know if this is ever gonna make
it to an edit video if it does I'll be
shocked but the poor people who are
watching this live stream have watched
me try to get started coding something
for just like the last half an hour and
I've really haven't get to click all
time but I think my friend my old friend
here Gloria pickle she's going to help
me out I'm going to be strong and get to
coding something go back to sleep and
we're gonna get started all right so
what is whirly noise I've got oh shoot
what happened
my setup it's all messed up oh this is
the wrong I was doing so well does it go
this way back yeah back back come on
whenever I move anything that's not I
totally like my whole thing is out of
whack okay
so what is whirling noise first let's
just have a discussion of what noise is
and I want to visualize noise in a two
dimensional canvas in a window on a
computer and the way that I'm gonna
visualize noise noise being another word
for randomness is by setting every
single pixel color of a two-dimensional
window to some pixel cups or some color
and I'll just do pure noise randomness
I'm gonna open up my processing window
here and I'm going to add setup and I'm
going to add draw I'm gonna make the
window size 400 by 400 and let's run
this and I've got my window over here
I'm gonna save this as whirly noise I'm
gonna draw a black background and then
I'm gonna do a nice for loop I'm gonna
loop over all the x's
and all the wise I'm going to get an
index a late
it's the toss the typing noise it's good
yeah I know
processing processing okay
so here I am in processing I am going to
write setup and draw you know III don't
think this needs to be and then this is
this is how to get that there okay how's
the font size by the way
I'm gonna make this project in
processing and I will also release a
JavaScript version of it but because I'm
going to do this operation
pixel-by-pixel to be very slow in
JavaScript canvas so without worrying
about optimizing it right now I'm just
gonna stay in a desktop environment
processing built on top of Java so I
have a setup function so I have a setup
function up there which gives me my
window size 400 by 400 and in the draw
loop what I want to do is set every
single pixel so every single pixel in
the window is going to have an XY
location I can iterate over every single
thick pixel with a nested for loop I
want these to be X's
so this so this loop here looks at every
single X and every single Y then what I
want to do is set every pixel at that
X&Y location so pixels index something
to a random value so I have to figure
out the pixels in a processing window or
store the colors are all stored in an
array a one-dimensional array so I need
to know for any given X Y what is the
index into that array and there's a nice
formula I can use where the index is X
plus y times the width itself
now this is something I've gone over
countless times but I'm just gonna go
over it again in this particular video
let's say that I have my window that has
one two three four that's five by one
two three four it's five by five okay
and if I'm looking over here the X is
zero one two three
which is right here and the Y is zero
one which is right here
now if I were to count the pixels
individually zero one two three four
five six seven eight nine ten eleven
twelve thirteen fourteen
how do I get this number well it is how
many over its X is three so it's three
over four five six seven eight it's
actually pixel number eight three plus
five is eight then this pixel would be
13 and this pixel would be 18 because
we've got to go five more down every row
so the x value three plus the y value
one times how many pixels are in each
row five gives me eight this is the
formula so I can apply that formula in
my code here X plus y times width say
pixels index and run the sketch I'm sure
so we've got missing a really important
detail let's run it and see what happens
anyway yeah no pointer exception why did
I get a null pointer exception because
the pixels don't exist I mean they do
exist I see them there they're pixels
but they don't exist because I didn't
know they exist they're there there are
pixels that's what I said
but I don't have access to them because
they I haven't unlocked the key to them
in memory and the way that I do that in
processing is by calling the load pixels
function pixels would be a pixel will be
a good name for a dog
sorry pickle her name is pickle not
pixel I could call her pixel as a
nickname pixel high pixel update pixels
I also have to say update pixels once
I'm done with the pixels there we go so
now I have noise this is not whirling
noise don't be misled by the title of
the window I have
whirling noise this is pure noise
randomness now I just want to have it
run once so I'm going to add no loop
here so draw happens once and I just get
a random set of pixels
Lode pickles now so what I've
implemented so far is noise but there
are lots of other kinds of noise I
probably have at least 10 videos on
something called Perlin noise and a lot
of the people argue is what I my videos
that are called Perla noise is actually
not really Perlin noise it's fractal
noise or maybe it's gradient noise
because Ken Perlin revised Perlin noise
to something called simplex noise but
simplex noise those are sort of
interesting history to that but I was
using in a different video
open simplex noise and what all these
different kinds of noise algorithms are
they're all rooted in randomness at
their core but something different
happens along the way what I implemented
here is literal just randomness the only
algorithm is pick a random brightness
value between 0 and 255 but each one of
these has a different kind of twist on
that with perla noise the idea is really
to create a smooth noise and you get
these nice textures that appear like
like clouds or marble and you can do a
lot with them so I would love in my life
to implement every kind of noise that
ever existed I've done some of these in
different videos I definitely
implemented them but I've made use of
them but in this video we are going to
do whirling noise another name for that
is cellular noise
okay whirly noise was introduced named
for Stephen Worley in 1996 and there's
this actual paper a cellular texture
basis function so I encourage you to
pause this video now and enjoy reading
this paper I would love to do a dramatic
reading of it for you
but I'm not going to at the moment I'm
just gonna stick to something very very
basic here which is just following what
literally written I'm gonna make my own
through I'm rather than read the paper
all the way through and try to follow
that to build worldly noise I'm just
going to follow this summary simplified
slur
that's on the Wikipedia page and there's
really just two steps of this algorithm
number one randomly distribute feature
points in space and I could use a two
dimensional space or a three dimensional
space and actually what's interesting
about this is I even though what I'm
drawing here is a two dimensional space
every pixel is in two dimensions I could
think of the whirly noise space as three
dimensional but visualize a slice of it
I think that's the way I'm gonna start
this to be perfectly honest so if I go
back to we could be you know the first
step is randomly distribute feature
points in space I'm gonna make an array
of P vectors we'll call that the
features
let's just make five of them and make
each one a random point so each point
has an X and a Y and a Z now the range
of what the x and y are clearly within
my two-dimensional canvas of 0 to 400
I'm just going to consider it to be a
box a cube where every dimension the
width the height and the depth is all
the same so I'll just use its own width
for the Z come on back to me then just
to understand that this is working I'm
going to comment this out and I'm gonna
draw all those points
let's skip the Z actually and I'm gonna
set a background so we can see them
there we go each time I run this I'm
gonna get a new set of points now I
don't I'm not so worried about
visualizing the Z I could do the
interesting thing I could do is I could
say let's make the stroke weight will
map the features Z which has a range
between 0 and width and I'll make that
between 1 and like 12 so that way I can
sort of see the depending on the Z value
it'll be a larger or smaller point so
you can see what's going on here as if
this one is closer now the Prospectus
with any kind of 3d perspective I'm just
trying to get a sense of what the data
is so now that I have that the next step
is alpha then X is distance and closest
point to X what does that mean
I don't like my lighting a lady seems
weird what's it there's a lot of people
watching this right now which is giving
me a little boost of energy this is by
the way a nice little coffee mug here I
guess there's some green in it but this
is a drawn by my daughter in her art
class class hmm can you put your laptop
up you're looking down which is weird
yeah and I've got this hat on too so I'm
probably doing this I should stand
should we both to standing it's too late
I should move to standing I should move
the camera back I should move to
standing okay
do I should I should I try to do this
slowmode thing because I can I can make
that happen
how's my eye let me see how my
soundboard is doing 12% it's up to 12%
that's pretty good okay all right here
we go because it's the Orioles no I'm
gonna tell you something baseball is
canceled which means the Orioles are
tied for first place this is their year
I think they might finish the year tied
for first place
okay move to standing please all right
well what part of this was I on all
right I'm trying to understand this
noise F of n of X is distance to nth
closest point to X see this shadow
behind me is really bothering me had a
soundboard and I can play some music the
worldly noise thing is gonna I'm gonna
continue that in a second don't worry
it's gonna get good soon let's just see
here see here how this goes I have these
rechargeable batteries and I've just
charged up I'm going to attach this
light here well let's let's make sure
it's actually going to turn on oh that's
pretty bright okay that's good I don't
know how long it's gonna last but okay
here we go
this open anything
how's that how am I looking what's weird
what's going on I don't know if that's
better maybe I should just have this
light over here about like two sides all
right I don't know I haven't really
improved anything but that's what it's
gonna be all right okay where's my
marker so I have my noise space with
some number of seed points now what I
want the next step is for any given X Y
point which I guess is just really
called X here so for any given X right
here
the noise function of X so I could have
an F of 1 of X I can have an F of 2 of X
is basically equal to the nth closest
point meaning this is maybe these first
let's let's draw these points in a more
obvious way and then I will number them
where's that other so we have this point
this point this point this point and
maybe I don't know another point over
here so this is the first closest point
this is maybe the second then this is
the third I don't know I'd have to get
out a ruler let's say this is the fourth
and this is the fifth so the idea is but
but I can choose a different n but for
any given n I want to color this pic get
a random value it's not
it's it's random only because these seed
points are randomly distributed but now
that those points have been distributed
the color for this particular pixel is
specifically a function of the first
closest point the second close point or
the third closest point so going back to
the code and let's make these let's make
these red so that I'll be able to see
them more easily let's put the pixels
back in just make sure everything's
working together let's make these points
a little bit larger so I can see them
better so now I want to look for every
given pixel which point is the closest
or actually I don't know that's like for
every giver every given pixel I want a
sorted list of the distances to all the
points
so right here I'm going to create an
array of distances which is a new array
[Music]
how many values need to go in it the
same number of values is the same number
of seed points so features dot length
then I need to loop over all those let's
get the distance between oh actually I
need to store the distance between what
between the X and the y the given pixel
that I'm looking at and the given
feature point that I'm currently on in
terms of this iteration cycle and
actually we want to keep the Z here so
these points I'm just looking at a slice
where Z is 0 but I want the X the Y and
the Z of all those feature points then
you know what's lovely about this I
could just sort them because it's just
an array of floating-point numbers the
processing has a sort function which
knows how to sort and array of numbers
so I can just say sort the distances
wonder if that makes a new array well
we'll find out and then I just need to
get that distance let me get the closest
one so this is this is if N and is 0 so
just have everything name correctly in
my code let's create a variable called N
and set that equal to 0 so the distance
I want to look at the ends closest it I
want to look at the end closest distance
in the array and then set that to be the
color interesting we can sort of start
to see little little circles that are
going on here now I need to deal with
some map in here the mapping is way
right because what are these what's the
range of these distances well it's
somewhere between like I mean it really
depends the cube is the width height and
depth is all equal to 400 or or width is
the global variable let's use a mapping
so let's call the brightness I'll just
call that B is map the distance which
has a range say between 0 and width
divided by 2 let's just take half of
that and when it's really close I want
it to be super bright when it's really
far away I want it to be super dark so
let's make that the color for every
given pixel hmm what did I get wrong
here
I've got something quite wrong here
map distance
hmm
this looks good to me I run it again I
get a different result no oh wait I
wonder if no no jurors distance or index
the X the Y let's get rid of the Z for a
second oh I guess I just um my range is
really off because of the Z does depth
space oh you know what's going on here I
think I think the sort function in
processing is making a new array yes
okay so the sort function this sort
function was not was sorting the array
but it copies all those distances into a
new array so that array wasn't actually
sorted so I need to create a I need just
to take the new array and said you said
equal to itself and now let's put the Z
back in oh well this is zero
it's just that slice there we go that
makes more sense
[Music]
let's create a lot more points I'm just
curious
people in that chat are very upset with
my wasting of memory well you know life
goes on
interesting so I don't need to draw the
seed points anymore so this is what I've
got it looks a little bit strange
mostly because of Maca said I'm not
upset upset good yeah I'm gonna worry
about the memory stuff in a bit but this
is this is this is good enough right now
so this has a kind of strange almost
spherical like quality to it it's
because I started with this 3d space
and once again let me let me let's go
back and let's just have 3d seed feature
points 2d features so if I get rid of
the Z point now I have you can see this
looks much more like a Voronoi
tessellation because literally what we
have is every point is colored according
to its closest to the closest point we
have this looks exactly like a runway
tessellation because the definition of a
Voronoi tessellation is cells where
cells that are divided by the dividing
line where all the points in this cell
are closest to a particular seed point
or feature point you can kind of see
these now because I'm coloring them
according to the distance you get these
kind of like glowing little spots and
what's interesting about this is right
now and I don't know I don't know what
the frame rate is here let's let's take
off no loop and let's let's let me just
print the frame rate out for a second
just to see am I even going to possibly
get a reasonable animation here yeah I'm
kind of running you can't see this
because I'm covering it but I'm running
it like five frames per second which is
terrible let's go back let's go down to
like 400 by 400 and just 25 seed points
there's lots of things we could do to
optimize this and I've got 30 frames per
second because what I want to do now
that I think will be fun to look at is
what happens if I go through and look at
do this same loop where I look at all
the points
and move them around randomly I'm gonna
do essentially a random walk with each
of them we could see we could see what's
happening right if those points move
around the whirling noise is interesting
now I haven't done anything having them
move smoothly or with any kind of
thoughtful behavior but you could start
to imagine if these points were moving
with a flocking system or any other kind
of thing that I've done in this channel
it's pretty interesting what we've got
let's go back to the 3d features yes the
distances are much greater why can't I
not get the 3d one to look like what I
want I think I know what the issue is
Andy
let's move these around again
kind of interesting
you know might I guess the Z is so large
that it might make sense to actually
consider this something like oh because
I'm at zero also Oh interesting
you know what I should do I should
really for this to make more sense I
should really have this be a number like
this
I should really have the Z range like I
want that slice to be in the middle of
this cube that I'm visualizing so I
think that that would make more sense
and then I I think it's gonna kind of
map yeah so this is this is more like
what I was expecting to see in terms of
whirly noise using a three dimensional
space like bubbles in a jar okay I'm
gonna let I'm gonna let everybody
watching this who's gonna make their own
version of this play with the motion and
I'm not gonna worry about that right now
and I'm gonna stick with a nice no loops
just run at once okay so here's my
whirly noise once let's go back to 800
by 800 I'm gonna double the number of
points I really should quadruple the
number of points yeah and here we go
this is this is the whirly noise pattern
I have now listen here's what's exciting
about whirly noise this is really the
same as visualizing a Voronoi
tessellation but I've got an option here
remember the idea is that I can I'm
taking the nth closest point so what
happens if instead of just using n at 0
what if I take one what if the distance
is not what if the color is not a not
mapped to the closest point but the
second closest point so let's have that
be right here n of one look at this we
get a very different kind of pattern
it's very crystal like so this is
another kind of texture that you know a
lot of these algorithms were developed
to make textures that would be applied
to 3d objects that it's really quite
lovely what happens if I change this to
2 whoo well it's even it's even like
more jaggedy there's lots of possible
things that could happen here what if I
change this to 3 interesting I have an
idea what if now I have an R
a G and a B so distance let's let's name
these D 0 D 1 and D 2 for distance 0 1 &
2 and let's use 0 we're gonna use a
different distance for the red green and
blue component so the red color will be
mapped to the closest point the green to
the second closest point and the blue to
the third closest point that's pretty
interesting well this is way more fun
than I imagined it would be I should
probably do like hue saturation and
brightness let's try that let's try
color mode HSB 255 and I'm just I mean I
could call these now HSB but I'm now
doing hue saturation brightness so the
hue is the closest point the saturation
is the I'm gonna rename this just cuz
it's super confusing so we're gonna do
this as HSB color hmm pretty interesting
pretty trippy trippy is what I'm seeing
you know we could also do something
where it's like plus frame rate modulus
to frame cap modulus 255 so anyways I
could like cycle through a sine wave
here I'm gonna go back to the RGB that
was a nice little tangent I went on but
let's stick with RGB
now Louis is asking can you control the
drawn z-axis with the mouth so what's
interesting here is that I am fixing the
Z at zero so there's no reason why I
couldn't look at different slices
remember I'm looking at worldly noise
within a slice I'm just leaning a slice
of worldly noise in a 3d space so what
if I made this Mouse X now unfortunately
this is gonna render really slow I'm
sure my frame rate is really slow oh I
have no loop on but I'm also gonna need
to take no loop off let's go back well
let's leave it now I'm guessing if I
were to move smoothly that's I would get
a pretty odd no it shouldn't be Mouse X
it should be Z equals map Mouse X which
goes from 0 to with 2 between negative
width divided by 2 with divided by 2 so
that's really the full range of Z
because remember I this I the 0 is the
center of the of this cube and in the Z
and along the z axis at least so I can
see here I can start to sort of move now
it's a very I I think what I what I want
to do is I want to reduce the complexity
here and go back to 400 by 400 just to
see if I can make this smoothly animate
oh it's really kind of nice let me zoom
in on this for you
this is moving through that Z space and
I think it actually might be really nice
to just animate this with a sine wave so
let me give myself an angle and Z rather
than being mapped to the mouse sine of
that angle and you know I don't need you
to use map it's very simple I can just
take sine of that angle times width
divided by two because sine oscillates
between negative one and one and so now
let me just say angle Plus let me just
gonna move the angle by a little bit I'm
missing a semicolon why is that running
super ooh I think maybe you know maybe
the awesome maybe oscillation isn't as
interesting as I thought it would be no
this is what I was just moving too fast
yes this is what I was looking for it
should come back right why did it stop
I mean this doesn't need to be inside
the loop right now
there's a lot of activity toward the
center and a lot less activity toward
the edges
I think I want the brightness to make
this a little bit brighter I don't know
what a good strategy for that is
multiply it by a little something and
that seems silly well that's kind of
interesting some sort of an accidental
additive blending effect that I didn't
mean oh that's pretty interesting
[Music]
yeah this is more like us hoping just
give it a little glow effect
and maybe I might prefer the blue to be
let's do it in the opposite let's have
the blue be the sort of primary color
here and the red be the secondary and
green being the third color this is what
I was sort of and can I keep a sort of
bare minimum of color it really depends
where the points are seated what if I
have many more points
so let's do something interesting here
which is this is gonna be very very slow
but I'm going to just to sort of see
where we can get here what if I make
this 12 I'm gonna make this like much
higher resolution let's go a 1920 by
1080 now this is gonna run super super
slow but we can see this is kind of what
the pattern looks like but I can what I
can do is I can save this out so I'm
gonna call save frame Whirley in
processing if you use save frame and
this is a directory path so a folder and
a file name what this is going to do
it's going to name all of them it's
gonna save every frame out as an image
and name it on numbered 0 0 0 0 0 1 0 0
2 you can just let this run for a little
bit and then I can render this to a
movie file well this is this is this is
really picking up let's get the music
going I'm at 28% here in the soundboard
so I can hook this back up I'm just
gonna let this be a full screen you
don't need to see me right now and we're
gonna let this render for a little bit
you hear the fan of my computer let me
put the camera back on so I don't know
if you can hear this this is the mic I'm
moving it down to the can you hear that
that's what the fan of the computer is
doing
okay
this was really meant to be a coating in
the Cabana video the keying is not so
great here know what let's just let me
give you this actually the other thing
that's interesting is this is going to
be a perfect loop I just realized
because the sine wave loops am i muted
now now the mics gone
it came back though right am I still
muted hmmm yeah the mic is back I don't
know what happened with the mic I think
that cable is just loose if you render
the cube you could set the Alpha of
every point that is black to 255 meaning
you only see the spheres which would be
very interesting yeah that I should
definitely try it rendering this in 3d
because I would love to see that I'm
gonna take a short break and let this
render for a little bit let's see how
many frames we got
[Music]
so work I wish I had been more
thoughtful about this because I could
make us a perfect loop but we're up to
118 frames how many frames someone do
the math for me if I'm going up by point
zero one a full cycle would be 0 to 2pi
so if does this calculator have PI in it
scientific high times 2 divided by point
zero one so 628 or approximately doesn't
628 images
628 frames where am I
we'll get there
should have made a full screen button
627 all right
[Music]
oh girl yes yes you're sleeping this
through this whole coding challenge
solar liner in the chat is saying I can
import the slices into blender as a
volumetric texture do I like that idea
5:20
she is just sleeping through this whole
time we're gonna go for a nice long walk
after we finish rendering this worldly
noise
[Music]
halfway there there we go
[Music]
Victor's asking where's the cat let me
see if I can find the cat there's two
cats
[Music]
Oh camera went off not a coating Josh's
asking isn't it always at home it is not
always at home usually I record a studio
space at NYU let's see would we would we
want to try this fancy Q&A thing that
I've that I've theoretically have
possible now anybody want to call in
from our supporters chat we want to test
the calling capabilities if you had a
question about this you want to ask
Oh was I getting you heard of buzzing I
don't think I'm hey oh yeah I did get an
emergency alert on my phone
New York City is seeking licensed health
care workers to support healthcare
facilities in need
visit nyc.gov slash help now to
volunteer also a brief rain shower will
begin at 5:07 p.m.
well by the way something that's
exciting that's happening is if you're
in the disk or if you're not in the
discord Jason hagglund who is the
illustrator for the coding train we see
if I can get the discord link to go into
the chat did that work
I don't see it there we go is creative
is working out some new emojis that's
already up some new emojis of the
discord soon can you please say hi to my
friend it's his birthday his name is
Nick Kerr
[Music]
so I don't know what your foot I guess
what I'm one thing I'm curious to hear
is how was how is this how's this vibe I
should change the standing up which I
try changing to standing up and see how
that goes
400 frames what what number did we say
we had to get to 627 we're getting there
we're always there pickle a little
pickle it's a good girl
so what would be interesting I know
there's two optimizations that would be
meaningful to do here
one would be to one optimization would
be to use a quadtree or a bin ladin a
spatial subdivision because to get the
three closest points we don't need to
check all the points everywhere we can
register the points in certain quadrants
another
another optimization would be to use
some to use with shaders frankly and
there are some good resources for doing
shape worldly noise with shaders which I
will try to pull up on before I go I
know I'm obsessed with getting all the
way to 627 what time is it over here
asks lemon it is 523 currently 524 p.m.
Eastern Time
let's see let's well and I'm gonna let
this keep rendering but I think the book
of shaders which is a wonderful resource
for learning shaders um has a section on
whirling noise possibly and I'm really
filling up my harddrive here each one of
these images is 2 megabytes 2.3 2.4 are
you going to render the cube I would
like to try that next yes definitely
want to try that next
we're getting there
I hear the pitter-patter of feet which
are not animal feet there are other
humanoid creatures that live in this
house I see one over there in this
direction she is approaching the
human-like creature is approaching oh no
she stopped doing something else
what's operator number one over there I
think what's going on operator number
one why do we get there yet so close
just like twenty five or six more to go
so the s I can't say the name in the
chat but why are the file sizes slowly
increasing so right there they're
increasing and decreasing and I think a
lot has to do with just the there's a
variable amount of color that's in each
image and you know whatever the PNG file
formats require like what you know based
on the number of colors or the the
actual pattern itself the file size I
guess gets larger or smaller all right
all right we got up to 628 we can stop
this now I'm gonna stop this now let's
come back to full screen here let's look
at this folder so inferior we don't need
these images let's look and see if our
suspicion is right this is image 628 and
let's look at image 1 did you memorize
that image let's open this one and then
let's go to 628 yeah they're they're
basically exactly the same so let's go
let's get rid of 632 all the way to 628
let's leave 628 just to be safe and now
what the next thing I want to do so how
do you render to a movie so I have a
whole separate video tutorial about
rendering to a movie and
I'm gonna but there's a tool in
processing called movie maker let's grab
that movie maker and I'm gonna get this
folder because I gotta open this back up
again and if I just drag the folder in
here you can see that it is pulling all
the files from this directory I want to
use the same size as the originals
I'll stick with a frame rate of 24 I
will keep the compression as PNG why not
and I'm going to hit create movie and
we're gonna save this we're gonna call
this Whirley now we have more waiting to
do it let's see what other questions I
can answer
I could use a HH rd as suggesting ffmpeg
which also could be used
it's going this is faster at least right
much faster
[Music]
oh good you got a puppy you're six years
old she's six years old
time to go for a walk Thank You Rock
respawn oh well so much for that
my vmix crashed probably filled up the
hard drive or something hope this stream
is still working so I see in the discord
Coby is setting up a but a way to manage
up some QA which we'll just do for like
15 or 20 minutes just really is like a
test so let's not get too overly
ambitious I want to if we want to be
done by 6:00 p.m. start the weekend I
got to get out I got to get outside for
a walk pickles got to go outside for a
walk kind of check on my children but I
wanted to test how it could work for
people to call in be a discord and ask
questions so because I have this headset
which I will be able to hear people and
I'll be able to send the audio from
discord also out to
through through the livestream as well
okay we are done see how this went
you can't close this now you can go to
the desktop and we have it here let's
open it up
Oh what happened here we go little boy
oops I forgot that I'm got pickle here
in this one okay hold on let's let me
give you a full screen view can i play
this full screen full screen making an
attempt here come on you can do it
No
can I export this to some convert stream
let's try this this looks good
right I don't know save as a file let's
choose another destination Whirley
export save
let's see how this goes let's see what
we get
almost done here okay that's promising
let's leave this opens with there we go
alright everybody ready for this
look what's appropriate music for this
[Music]
this is what we made today yay
alright save well it's what save it as
something else
hey that's only five I got this down to
like a 5 megabyte video file that's
pretty cool alright alright what are
some other things we could try before I
go before II what before the Q&A we
before we attempt the hat lets okay so
let me do let me I'm gonna just freeze
this I'm gonna whoa hold actually I
think I'm gonna delete or just gonna
move this to the desktop and let me save
it swirly noise 3d so what I'm gonna
attempt to do now is actually visualize
it in 3d you understand exactly how I'm
gonna do this like do some kind of like
voxel visualization so let's see how I
might do that yeah so let's let's keep
it the way it is and I'm gonna change
this to P 3d
I'm gonna go back to just like 800 by
800 so this is what I get just looking
at that 2d slice and now I need a triple
nested loop
where Z starts here this is Z and let's
do let's do let's have like a skip
factor of like 10 let's just do every 10
pixel right now I need another I don't
and I'm not doing load pixels and update
pixels instead I am saying push pop
translate what am i translating to XYZ
why do I have an error here oh because I
have multiple disease we're gonna get
rid of this X Y Z and we're gonna just
draw a box that's of size 10 and let's
give it a fill with an alpha just do I
see what do I see here if I do this okay
so that's that's what I was hoping for
let's say no stroke let's make this skip
and this should be the Skip size let's
make the Skip much larger like 25 okay
now what let's try adding mmm let's try
adding that the easy cam piece of cam
library just so I can kind of view it
and the PC cam library allows me to sort
of view this thing in 3d so if I go I'm
just gonna look under examples just get
the basic view cam example which is just
hello peasy is all like what so I want
to have a piece of cam instance then I
want to create in setup a new PC cam
I need the import statement up top as
well I have a feeling it's gonna Center
everything around zero zero let's just
see what happens right so now this is
the 3d space but I am NOT I want to be
sort of further out away from it I think
there's a way at that this 400 value
must be like how far away I am from it
yeah there we go so I'm further away but
the corner yeah there we go so this is
the cube but I think what I want now is
to think of the space unfortunately as
around the center so I need to do this
for everything those are the random
points and then also this for X Y so X
X&Y also an in so let's see here I don't
care about this index thing I'm not
doing pixels anymore
I must have it's all 3d I'm not using
the color yet but let's sort of see okay
so this is what I'm looking for I'm
seeing this full cube I want to be much
farther away from it is that I thought
that's what this variable is yeah there
we go
there's the cube okay so I see the cube
now dare I attempt to now color it with
the RGB values whoa look at that that's
pretty interesting what have I done a
little weird whirly noise cube so it
looks just like the textures on the
sides I think I need I let's let's go
back to just one color let's just go
back to this idea n just as one color
and Phil let's fill it at 2:55 but who I
lost the mapping why did I lose my
mapping no I just want to have one D
keep this as n but what I want is for
that mapping to be 255 comma this is the
Alpha basically I want it to be the
Alpha so I want the transparency to be
based on the work the noise itself I
feel like I'm not seeing through it in
the way that I had hoped don't need to
show the voxels can you now set the
Alpha of every voxel that is black to
zero that's what I think that I've done
maybe I want the colors but also include
let's just try this for a second
yeah I think what if I do like additive
blending Oh weird the Alpha is not
working I think maybe the order that I'm
drawing stuff something is off the
transparency is definitely not working
because look at one side versus the
other something is weird what if I give
it no fill stroke stroke alpha so that's
pretty interesting
and let's go back to n of zero
I think somebody else with a more clever
design abilities will have a nicer way
of doing this there we go this is more
like what I was looking for let's skip
let's skip even more yeah this is kind
of interesting I mean I don't know what
I've really got here but
cubes with different sizes oh that's a
very clever okay let's try to do the
size so this is the size which we will
have when it's closed the size is large
that's skip value all the way down to
zero we're gonna have no stroke and we
will have the fill consistently be 255
with an alpha and this is now the size
and like this idea whoa this is good
now we're talking whoa that's wild
okay I should go back to the RGB colors
too
[Music]
yeah this is more interesting here
there's definitely like a weird kind of
Z sorting order and let's let's just
make this smaller and let's see can I
get down to a smaller skip yeah
let's make this zoom out a little bit
more I think actually I don't know why
I'm yeah I can just do this with a
scroll ooh
so by having trouble controlling it oh
so there we go
here's my whirling noise cube and what
happens if I use instead of an N of 0
and n of 1
let's give some lights here
weird
okay I think I'm finished for today it's
5:45 how are we with our possible QA
setup so I will remind you let's go
let's get let's go back to the original
whirly noise I'm going to comment out
the save frame function and I'm also
going to reduce the size down to like
640 360 and let's just make 20 points
yeah there we go so this is a nice
version that will run in real time
invert the cube size that's kind of an
interesting idea let's let's try
inverting the cube size no I can't open
it up nope that's my audio application
there you go
the 3d one go there it is if we invert
it this would be zero to skip I think
this will actually look the same so
maybe it won't like have a similar
quality to it yeah because it's just
sort of like the noises flipped but now
let's quickly very very quickly I want
to port this to a p5.js and just see if
it'll run in the browser okay so while
we're seeing it works if you want to do
it okay so the QA is ready so what
instructions do I need to give to people
we're just gonna try this as a test
maybe we're gonna do one or two
questions somehow see if we can get that
working with people coming in via voice
let me know it's ready so you have to be
in the discord if you want to
participate and it's gonna be sort of
random right now I think what I maybe I
don't know if we should limit it to like
people in the supporter chat or ever let
the people in the discord
that out probably should test this I'm
the idealist to test this with the
smaller of them YouTube members first
but what are you gonna do alright so let
me go to the browser and let's go to the
p5 editor let's login
why am i not logged in here oh there's a
cat okay so now let's just paste this in
and let's see if we can get this to work
in p5 so there's what do I need to
change so this is just an array this is
just a plain old variable this now you
can just do this we can just hard code
this as 20 this is create vector this is
function draw function setup create
canvas let how am i doing background
zero little pixels let let let let let
let let let okay equals features index I
and the distance is between X Y Z and V
dot XV know that that still is the same
sort I think still works let let let let
let let now here's the real ah the big
thing that's different is this so this
needs a times four because unlike in
processing the pixels in p5.js have four
spots alright so I'm just gonna polish
this for a second to let you know what's
happening with the Q&A so if you
or in here's a link to the discord
that's going in the YouTube chat if you
haven't joined go to the QA talk channel
in the general section then you need to
go to the bots talk channel and then you
need to send a message which is question
mark you space join and wait for your
turn I'm gonna open up discord here at
some point but that I guess and maybe
there's people there chatting who can
help you
index okay whoops we're gonna take calls
here live on the coding train this is
going to be new just voice calls right
now we can do video at some point then I
need to say pixels index plus 0 is the
red value plus 1 is the green value 2 is
the blue value and then I need to set
the alpha myself manually to 55 so
unlike in processing where you put a
full integer color into a spot in the
array what you do here is have each the
RGB and alpha values are in separate
spots in the array itself and so for the
x wise you look up that point and
multiply it by 4 I think I've got
everything here what did I miss
what's the chance that this is gonna
work I would put it at less than 10% but
we will give ourselves a little drumroll
nonetheless
you got a little louder for a fact
oh okay ah this is a really weird
problem that happened that I know what
it is very unexpected surprised how well
this worked so this is a high density
display a retina that Mac Retina display
and so in order for there's actually
double or quadruple the number of pixels
then the actual 644 it might specified
so I think I just need to manually say
oh my god and I have killed this
computer but I need to manually just say
pixel density 1 and you know what let's
make this let's just make this really
small right now 200 by 200 just to see
that it that's really let's not let's
not okay so you can see how slow this is
even just at 200 200 but it is working
let's go down to 100 100 yeah so you can
see it's just this pixel manipulation
stuff is really really slow in the
browser so this same exact sketch at 100
byte you know that at that pixel
resolution of 640 by 360 now there's a
lot of inefficiencies and what I've
coded that could be optimized but you
can see how kind of chunky the animation
is as opposed to and I can barely even
tell it to stop as opposed to in oh you
know what I'm running a lot of other
stuff on the computer that certainly
doesn't help but as opposed to in
processing where this has no problem to
render at a fairly reasonable frame rate
so porting this to WebGL using shaders
some how to operate the pixels there's a
lot of ways that this could be could run
really fast and I'm and I suspect if I
look for like whirly noise you know
WebGL I'm gonna find some really nice
demonstration right and this I think is
what I was referring to this book this
book called the book of shaders here we
go we can see here here's that same
algorithm running
or a similar algorithm running in WebGL
with a shader code let's see what
happens if I get further down yeah look
at that and this by the way is what
happens when you move the points around
more thoughtfully oh these are just like
what how are they moving they're doing
like a night a nicer random walk this is
the other thing that I really want to do
I just want to move them according to
some particular algorithm like flocking
let's do that let's just add the
flocking Gallagher there real quick or
should I do the QA well flocking is kind
of overly complicated hmm all right it's
okay we're gonna make this happen this
is worth it whirly noise so let me let
me draw these features just so I see
them and features the why did I get a
negative width negative width divided by
2 - width / - yeah so this is where
those feature points are what if I also
move those feature points so I could
just go back to the random of motion and
that just makes it like jiggle a lot I
want it to feel much more smooth so what
if I get any of my nature of code
examples
send them off in a random direction that
bounced off the edges of the screen
that's probably what I should do let's
just do that that's fine let's do a
random direction I just need a particle
class is the problem so let me let's
let's look at what examples I have
that'll do this nicely really fast under
agents perhaps a flow field stay within
walls this is a good one to do arrive
path following separation flocking a
separation one might be kind of
interesting let's look at I mean I could
do the wandering one also oh the camera
went off again I wonder why
battery exhausted Oh like what's the
cable loose
that's what's going on let's give it a
minute see if it charges up again it's
charging now I had it I had this camera
plugged in but that's why it was going
off okay should be fine now
ooh there we go all right let's just do
so this is I'm gonna leave this as an
exercise to people watching this I have
so many different kinds of emotions
behaviors but I'm gonna go with I'm
gonna go with something much simpler and
let's just look at an example from
chapter one which is like bouncing ball
let's just grab this one so I'm going to
get this class which just has it's a
nice like quick bouncing ball class and
I'm just gonna call this a particle and
let's just change this to particle and
we want to make this a random vector so
this gets these each get a random
position all right okay hold on a sec
hold on everybody's this is what I need
right this is these are going to become
particles now so this is gonna go in the
particle class the velocity is going to
be a random velocity what's
and then this looks weird okay I don't
know what's going on here but this is
fine and then we're gonna update the
plot bossy it's gonna bounce off the
edge we have a display function in case
we need it so now the features are
particle objects and there are twenty of
them there are particles the position
gets picked inside and then now the this
is a particle or actually its features
dot position and so that all that stays
the same and now for each of the
features what I can do is I can say
particle P equals features index I and I
can say P dot of display so let's just
make sure this works so there we go so
these are the particles and now it's
doing the noise based on those particles
and now if I call update on them they
should move and I want them to move much
faster than this so let's give them
let's increase their velocity to like
multiply them each by like five and
there we go now it's sort of hard to see
what's going oh because let's not draw
them looks like it's running much slower
yeah so in addition to oh the camera
went off again but in addition to the
slices they're actually moving let's get
rid of the slices for a second let's
just override
let's not increase the angle let me just
give you just the computer for a second
I'm gonna get rid of the slices so now
you can see this is what it looks like
with them moving
[Music]
so anyway you've seen now many more
possibilities here
let's truncate the the QA is ready we're
gonna we're gonna switch we're gonna try
the QA so we try to go to just it's
charging
hopefully it's not charging fast enough
so let me see first I'm gonna go into
the discord on this computer I've got to
do a couple things pots getting dark in
here weird sort of way okay so let me
open up the discord we're gonna try this
Q&A everybody get loopback this court is
on so now we should if I go discord this
is very exciting this is a very exciting
moment here a fear first Q&A with live
talking where should I go here should I
go to so I guess I can just leave this
open because I'm in streamer mode I need
to go to the coding train Q&A there's
lots of notifications I should go to
which channel which channel do I go to
bot talk no voice chat Q&A talk so I'm
going to join that channel hello done
okay so I think your hello Dan just went
out through to the live stream everybody
can everybody thumbs up in the live
stream that you heard a hello Dan I also
hear a typing this is my ear and I see
you I'm just gonna show you what the way
I have this I'm using a piece of
software called loopback I'm gonna close
it let me open up the this again so this
is the software that I'm using and
basically I'm taking the audio from
discord and it is going into USB capture
which is what's going to the live stream
but it's also going here into my into my
earphones is that a word your phone's I
think it is this is and by the way this
is coming from the sound boards so if I
play this so I'm ready for some Q&A
I don't know how how this is gonna be
manager if I should be having the
discord open I could look at it on I
could also look at the discord on my
computer over here let's try let's try a
couple questions
it says Wow Wow there we go I have a
suspicion that it might be Simon who
joined first yes we hear sigh that's
right go ahead Simon sir what is your
question I think I think I don't think
everybody getting to hear Simon's voice
is an exciting moment and if you haven't
checked out Simon's channel I think if
you just search Simon Tiger on YouTube
probably it will come up I can confirm
that that's the case
by just typing in going to YouTube
typing in YouTube Simon Tiger let's see
and here we go this you can find Simon's
YouTube channel where he has lots of
exciting coding videos right here
exactly before we go to the next person
I see there's a lot of people in the
YouTube chat still asking question all
right not too sure about how to join so
for those people you can join the
discord and then in just go to the
bottle channel and there'll be a little
text in there how to join the Q&A and is
the audio balance
better now would be a question
unfortunate a little bit quiet for me
but I lowered it I'm sure I can figure
I'm sure I can manage that I can still
hear it so it's fine well work that out
next time but hopefully the audio
balance is better X I can turn this down
here hold on I write and then turn this
up here
Koby can you talk for a minute again
let's see how it is yeah all right so
that's all right so that's much better
in terms of my volume but I'm curious
what the levels are for the audience on
the live stream yeah we have to wait
about 36 no it's low so that's so easier
for easy for me to raise it so I'll just
raise it up a tiny bit and that should
probably be a little bit better now
there we go
okay I think we might move on to the
next verse yeah hello hello Nikki
various stuff I want to stand German so
I'm sorry for anything oh no you're
doing great
we're in Germany are you thank that's
nice Bob hey I don't know if you know
about it
I you know I've been to Germany and but
I owe I spent most of my time when I was
there in Berlin so that's my American
knowledge of the geography so what
what's your question today um I want to
know that you know about to silage
rendering because um most triangles in
3ds rendering our Energon to sites so
one is invisible or both are visible at
the same time processing that could be
the problem why you couldn't set the out
to zero
okay the way you play was my suggestion
yeah okay so if I'm here in and if you
know you won't be able to see see my
screen where I am in because the
livestream you're the euros like 30
seconds ahead of the livestream but is
that the two-sided rendering is there
like a setting that I can change in
processing that would just you're saying
that we just fix this or you're just
like the concept of you're talking about
the concept of two-sided rendering and
you're wondering if that's something
that's the reason yeah so I think yes I
think that is the case I also recall
that there is a way there's that it's
having this issue before and it could
also be related to the order by which
I'm drawing things but but you're an
idea sounds a bit more sounds right to
me because it it was like when I just
looked at the other side of it so if I
open up the cube right now because it
looks very different one side versus the
other it's it's dark on this side and
brain on this so yeah my I think you're
probably right okay
I think that's the work because from one
pipe it's passing through so you can see
on one side but on the other side like a
claim cuz you can't be Foucault z alpha
is still sick yeah so III I think that's
probably right you know to be honest
like I do so little 3d stuff but I guess
if I search like two-sided rendering
processing you might get some we might
get some I guess well I probably need to
type in processing Gord we might find a
solution eventually excellent thank you
for that suggestion I think you're
probably right that that's what it is
okay thanks thanks for calling in
what remind me your name again my name
is neither Nisa yeah awesome this is fun
like this is like a coding talk show it
probably wouldn't be good for people to
join in video in some ways but it's nice
to hear people's voice
so thanks should we try shall we move on
and try another question yeah sure
discord moderation magical people Oh bye
bye thanks for calling in this is still
run I think David's might have slightly
broken the ball okay well you know I
think I'm gonna have to wrap this up
pretty soon anyway this was a bit of a
test to sort of see how it might work
for to do like a QA you know I kind of
wanted to do a some kind of like special
thing to celebrate 1 million subscribers
you know I have to admit it didn't
really happen because I'm just gonna
mute this for a second yeah I'm hearing
a lot of noise and the check is I should
keep this open oops
but I don't know with the with the
global crisis that we're all finding
ourselves in it didn't really feel much
spoken billion subscribers but and I've
just been sort of focused on other
things like getting through the day and
doing a little something every day
dealing with and helping family and
friends out but at least we got I got
this live stream out and we got in this
sort of test of this voice system what
might make more sense is to do this as a
separate thing maybe just once a month
it could also be something that I do
just as with a smaller group as a
benefit to people who are patrons or
members you know I'm certainly not in
the mood to ask people to join right now
I know so many people are struggling
financially and out of work and you know
there's no there's no need for anybody
to join pakodi trade right now but this
is a nice thing to be able to do are we
- are we are we set up to maybe try one
more person or should I should we wrap
it up for today the next person sent me
the the question he wanted to ask
because it doesn't have a microphone Oh
what what coding languages do you know
okay who am I talking to right now
obligate
the voice was soda liner one of the
moderators oh okay yeah they're quite
what coating last bite are the great
yeah so what coding languages do I know
I would say that let me try to do this
in order of how many learned them so the
first programming language I ever did
was in elementary school in the 1980s
was basic and basic programming language
on Apple 2 plus then I didn't program
again at all until maybe middle school
or high school I think I should learn
some assembly language then I didn't
program again at all until I was maybe
like 22 or 23 and I took like an evening
course kind of guessing here in C and I
was kind of like not for me then then I
went to graduate school at ITP which is
the program where I teach now at NYU and
there I learned the lingo programming
language which is invented by John Henry
Thompson if you're not familiar with
John Henry Thompson you should be a
luminary
in the world of creative coding this is
John Henry Thompson I'm pretty sure if I
search go to videos you'll see he came
and was a guest on the coding train at
one point but invented the lingo
programming language which was the
language for Macromedia director so
that's what I first that's where I
really first was programming because I
was doing it intensively in an intro
class from there I learned Java I
learned C and C++ but so I know all
those languages that I have described
but I would say probably Java is the one
that I spent the most time with and then
started working on after I learned Java
was working with processing which is
built on top of Java and more recently
in the last five or six years I've been
learning and doing stuff in JavaScript
so Java and JavaScript are the ones I
probably know the both most and Python I
could make my way around if I need to
I'm often like calling finding Python
scripts and running them who's a part of
a project or a thing but it's not
my expertise so those would be that's my
that's my long-winded summary of all the
programming languages I know I think
there might be a follow-up question
coming okay
well nevermind it's just saw the great
thanking you answering the question
excellent all right so oh look camera
keeps going is it because of the battery
must be that it's not then I didn't have
it sitting and charging and the battery
is just very very low turning it back on
so I think maybe I'm gonna wrap up for
today I don't know if battery exhausted
yeah I don't know if I have an idea here
is another camera I have where I am this
is the camera that I had on the drawing
whoa very close yep for one more
question we had one yeah yeah let's have
let's have that question come in with my
giant head
[Music]
dc-6 are you able to speak
tt6
it might be broken
give me two seconds I will do mine is
unmuted him manually so if you can if
you want to ask a question go ahead you
should build a Speak Now DT six some
technical difficulties apparently he is
able to speak he's not muted currently
so I think it might be a mic issue
unfortunately yeah you're welcome to
type your question I'm happy to try to
answer it but Wow while we're waiting
for maybe the question come and read it
out okay great
well waiting for the question to come in
so this was this to me as much as it
took me like a half an hour to get a
little bit more comfortable and get over
my own like anxiety confusion about live
streaming from this setup I think that
this went pretty well and I'm hoping
that I can get back up and running with
live streaming once a week I don't think
my like recording to disc stuff worked
really well so I don't know if the
whirly noise example will get end up
being edited into its own video that
would then have a coding trade page
associated with it so if you're not
familiar if if I just go to the coding
train website all of the coding
challenges and the coding the Cabana
videos and other tutorials as well if I
go to any given page like let's go to
one that I know has a bunch like that
maybe this raycasting video if I go here
to the challenge page you'll see all
these community contributions we have a
system for you if you make of your own
variation of it to collect all these but
I don't know that I'll have a whirling
noise page but I would love to be able
to collect all the whirly
projects if people make variations of it
and I certainly will upload this code so
let's think about how we could share
that the discord is certainly a way so
maybe we can have a discussion in the
discord after the stream is over and you
know fake and create a web page just for
the worldly noise because I do think the
whirling noise code opens up a lot of
possible variations and I'm sure a lot
of people watching will have clever
ideas about how to visualize it even
without an animation just to sort of
like render a high-res version of the
image with thinking about color and
texture in different ways so I'd love to
be able to collect those so if you're
watching now and you're not in the
discord and you want to discuss that
join the discord we'll figure out a way
to collect those we could also obviously
you can share those with me on social
media at Schiffman on twitter at the
coating train on twitter there's
actually a coding trade Instagram the
coding train so let's I would really
love to see if you're working on
something whirly noise from this also
maybe what I can actually do is just
kind of redo this but in with the coding
in the Cabana setup so I could click
sort of refilm the whirly noise just
sort of walk through just do it again
into the editor together to make it a
its own standalone video okay I hear a
voice okay six yeah it's background
noise for me I'm sorry didja six
question is where is the remark encoding
Xiamen ah where is the ray marking
coding challenge so the I don't I don't
think I have a proper ray marching
challenge I have this ray casting kind
of the same thing but different and I
have this rendering ray casting so these
would be the ones oh you don't see what
I'm looking at Oh my whole setup is kind
of broken right now but there's these
two challenges that you could take a
look at if you're interested in more
sort of like proper ray marching I
believe that Sebastian lag has a video
tutorial about it coding adventure ray
marching so if you're not subscribed to
Sebastian laggs channel it's really
excellent
there's lots of really wonderful
tutorials and well I don't know the
tutorials is the right word but sort of
its explanatory video essays in a way
about different algorithms which we've
done in unity with 3d so but methey that
I'm really planning to do soon I was
thinking of doing it today is I really
am
speaking of Sebastian leg lag is a
marching squares marching squares is a
wonderful algorithm to create I have a
video where I made these meta balls
pattern also known as meatballs but you
can create this kind of animation
with the marching squares algorithm as
well so I don't that really answered
your question but that was a followed by
Simon who says you do have a rate
marching livestream it just hasn't been
editors into a video
really apparently lively 177 just can't
remember this at all
look now there's double me okay you can
see this is this camera right ray
marching livestream 177 yeah I think
this is oh you know what though I think
I just caught it's just the title is
called ray casting and ray marching
because I didn't I think if my memories
is correct
I think I didn't know what I was doing
investigate this are they the same thing
are they different and you know to be
honest right now I wouldn't be shocked
if I got it kind of mixed up but my
memory is that the algorithm that I
implemented was more specifically
related to the term Ray casting and Ray
marching is a little bit different so
there's maybe there's somebody in the in
the discord voice channel who knows
precisely the answer this could just
pipe in and
and and fill in all these gaps but that
that's I'm pretty sure that the only
thing that I did are those two
particular examples ah Milan by the way
in the chat rightz what is the best way
to teach my nephew programming so I
would say first of all the age of your
nephew is a major consideration but I
would say if your nephew is 12 or 13 and
up
certainly the this playlist of mine and
again I'm not suggesting that my stuff
is the best for teaching programming
it's just that I happen to know what's
there but this particular playlist code
programming of p5.js is meant for a
total beginner so you know I wouldn't
necessarily suggest this for elementary
school age although certainly some you
know Simon viewer Simon was probably
coding this up like in elementary smutch
younger age but and really if you if if
a an elementary school student is
capable of typing then I think following
this is possible but certainly middle
school and high school and up all the
way to any age really this is my
beginner playlist for elementary school
age you know I would take a look at
scratch and I know that scratch has been
doing some new initiatives with maybe
sort of teaching at home and that type
of thing but scratch is a is a block
based coding environment I did actually
a little weekend livestream last weekend
doing some stuff in scratch it was not a
proper tutorial but you could take a
look at that as well because I did it
with my children oh it's right here so
you could look at this to our 40-minute
live stream where we programmed in a
couple projects in scratch okay so this
I think I think I'm gonna wrap up the
I'm gonna I'm gonna mute the audio in my
ear if that's all right so thank you
Coby and David and Nathan
than anybody else in the chat who was
helping with this test my intention was
to do a kind of like more of a rigorous
test with a smaller group but what you
know why not just try it here live this
live stream is wrapping up I would say
one thing that would make me
inordinately happy if that's the proper
room magic to ever to have use right now
what's this over here
though top-secret control panel this is
my top-secret discord control panel I
didn't know I had this mute deafened so
many possibilities but would be to see
let's let's come up with a hashtag I'm
gonna go to let's just go to my camera
here I'm gonna go to I just want to see
if I'm logged in on Twitter as anything
I'm not so I can't post anything but
let's let's come up with a hashtag a
Twitter hashtag for whirly noise and I
realize there's many libraries on
Twitter it's not the best way to share
this stuff but I'm gonna go out through
the evening and weekend and it would
make me really happy to see if people
make stuff with whirly noise so what's a
good what's a good hashtag David
suggests all the noise I think we might
need something that's related to coding
train what if we did like choo choo choo
choo noise
whirly choo choo really choo choo noise
noise choo sounds like noisy foo I don't
know coding whirly noise that's that's
pretty good whirly train
whirly train is good let's do this
whirly train Twitter comm hashtag and
I'm a little bit of I'm afraid of the
internet so I'm gonna just go back to my
camera here and look at whirly train no
results you could be the first you could
be the very first to have a whirly train
hashtag let's see if I can manage to to
post something noisy little whirly
tricky whirly bugs let's go let's see if
I can manage the law
to my Twitter here what's the chance I
can do that it's gonna take me a million
years through all my different
protections so hard for me to log into
anything because I have password manager
I've got to factor I can barely get into
my Twitter I'm gonna post my video don't
see how it looks just give me a second
maybe you will post something before me
we'll see I'm gonna look at my password
here which is some crazy sequence of
characters for six well you know there's
a 46 in my password good luck now
deciphering it shift
I didn't even type it incorrectly you
know what actually be good is to always
have the voice channel open you discard
and for like in emergencies people could
look like
so yeah your mic went off or something
like that really pickle that's pretty
good okay wait I need an authentication
code did I get it yes we have any better
hashtag suggestions let's post okay here
we go
whirly train that we're going with
people where Lee train Worley pickle is
pretty good whirly train pickle really
needs to go out for a walk well hi Stan
everybody's behind whirly train we're
early train whirly train and I'm gonna
get my video I'm sure compression will
kill it let's look at the let's see if
all right I am now about to tweet and go
back to this whirly train
thanks for watching the livestream today
everyone trouble writing my tweet
somebody help me here stay home be well
friends take care of yourself and each
other let's give ourselves some nice mo
jeez
so our pickle emoji that's gonna be
misinterpreted ah dog let's see there we
go rainbow some stars think I'm I think
I'm I think that's enough I think I did
my duty
all right how's this look everybody uh
whirly train
share share yours whirly train
okay I think this is good I am going to
post this tweet and say goodbye to all
of you I will let you enjoy some time
with pickle on my way out
let's see if I can
oops oops there's there's pickle and see
you soon goodbye everybody thank you so
much for tuning in thanks for bearing
with me as I try to get used to this
setup and figure out what it is that I'm
doing and how I'm how I'm continuing the
work that I do and also being mindful
and conscientious of all the struggles
and difficulties everybody's having and
bring something good and useful and
appropriate and say all the right things
and be nice and everything that I want
to be which is just to be a kind helpful
person and so your feedback is welcome
and I look forward to seeing you on the
next live stream I wish I could just do
this every day but I have a lot to take
care of at home but I'll do my best and
please your messages and thoughts and
sharing your own visual ideas are always
wonderful and I really appreciate it I'm
gonna play you out with some of my
ridiculous music like the this.stop song
[Music]
by the way if the discord voice Channel
is still going through I should turn
that off
okay discord voice channels off now you
can talk to I can hear you this this
this this start song never forget to
this start with somebody composed that
song for me
how long is this
so this is random this is noise Perley
noise that is in the core random
algorithm the actual random algorithm
itself those numbers aren't related at
all you pick like I'm picking random
numbers between zero and ten nine two
seven six one nine four eight nine to
one thirty I think nine why apparently
but with curly noise I might pick
numbers like this two three four three
four five six five four five six seven
five my microphone is still on my
microphone now this is like Perlin noise
performance part birthing noise but with
purely noise I might pick numbers like
this
three four five
by purling noise that is early noise
this is Hurley noise that is Hurley
noises this is Hurley noise that in
Berlin oh so this is Hurley noise that
is her pearling no Hurley noise this is
this is but with pearly noise I might
pick numbers like this
[Music]
this is like Perlin noise performance
part unicorns and rainbows and cupcakes
what else is there yes kids thank you
very much kittens and rainbows and
cupcakes notice that look what I get
[Music]
and I feel just sort of like a nice
feeling of relaxation everything's gonna
be okay today dream is not broken it
does not frozen this isn't this is a
wonderful thing okay we're gonna do it
I'm really getting to something I need
my sound
[Music]
okay
[Music]
all sorts of text generation analysis
things
[Music]