Houdini Algorithmic Live #080 - Rotary Silhouette

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right hello hello uh can you hear my voice let me know if you can hear it i'm testing out a new setup from another place so i'm not sure if this setup is going well let me know if you can hear my voice or if the sound is okay in terms of the volume right let's hope that it is going okay so since i am testing from another place to them don't really have a webcam as well so maybe next time i'll prepare a camera as well okay not sure if anybody's here well let me just start this okay so this is 10 p.m japan time this is e this is the weekly episode for houdini mclife a tutorial live stream for houdini with different topics and the topics for today is to create a more a rather easy to create motion graphics which is on top of a rotating spiral disc projecting a animated geometry on top of a disc and if you stop the animation looks like these i am controlling the the wires which creates this spiral shape and i'm offsetting the curve like these and i'm controlling the num the amount of offset to view it as a lightness of the geometry looking from the top view affected by the light some kind of a directional light and actually the geometry itself comes from this one this is the original geometry which is being projected on top of this spiral disk okay hello let me know if you can hear my voice i'm not sure if this is live hopefully it is all right the thing with this setup is that you can also change the geometry like these you can just project any geometry if it is a mesh type which then can be colored using some simple ray ray function then later on projected on top of this disk by offsetting these curves based on the intention the intensity of the light lightings on top of the geometry okay so pretty easy a pretty simple setup but a rather interesting effect in terms of motion graphics it's like uh rotating i don't know like um wheel on a bicycle something and if you look at the spiral you can see that the the spiroid sim seems like it's going inward from outward but if you change the the speed of the rotations sometimes it goes the other way around which is controlled right here if you make this negative value then the spiral goes from inward inside to outside which is also pretty interesting so let's try this out creating this from scratch all right thank you for the comment strider okay so first thing first i'm going to create a geometry node then and i am also going to save this so that i don't lose the process let me just save this to the folder so this is the ats episode yeah i've done a lot all right so let's do this so the first thing i'd like to do is to create a basic geometry that i would like to project on top of the disk a spiral disk so let's just create a box rotating box as a sample geometry which could be anything and which could be any kind of animation but maybe just rotating the box is simply enough for testing so let's just do this i am going to make the box size i don't know one for now and try to rotate it by controlling these rotational values based on the frame so i'm just gonna say ff frame multiplied by 4 on x frame multiplied by 1 on y rotation and frame multiplied by two on z which will just create some rotational vocs okay let's make this real time all right good enough for testing now let's also create a basic spiral curve to start with which can be done procedurally or parametrically and i'm just going to use a single attribute wrangle to create a single spiral curve first then later i'm gonna use another wrangle to control the thickness or the thickness of the curve controlled by the intensity of this box projected on the top of the plane okay so i'm gonna stop by creating attribute wrangle make it as a detail to create a initial spiral curve which is going to be the going to be used as the initial setup okay so let's call this init spiral first thing first i am going to define how many points that i would like to have to create a spiral curve i don't know how much a curve i need i mean how much point that i need it might be a good idea to just set a total radius first like the final radius first then define a point number based on those radius that might be more smarter okay let's say the final radius is red and let's say it's around 10. and maybe it's a might be a good idea to say how many rotation you want like like how how many times you want to rotate in terms of the spiral so let's say in that case maybe in an integer might be a good idea so number of rotation right so one rotation is around about like 360 degrees rotation okay so let's say if i want to have 100 rotations okay so with these informations i am able to get the total radius of the disk as well as the number of total rotational numbers so from this one by setting up some resolution like how many points i want to use for single rotation maybe i sh i should be able to control the total i should be able to get the total number of points in order to create a spiral curve probably right so let's say i have another parameter called a number of points for single rotation force 360 degrees let's say i just want to use 10 points for 360 degrees rotation then with those three informations i should be able to say how many how the total number of points that i need it should be around the number of rotation multiplied by number of points is the final number of points that i'm going to create for a total spiral curve so let's say i'm going to create a for loop which is a number of points multiplied by number of rotation then i should also be able to create an angle and that will be that should be dependent on this number of point so i modulus numpt multiply by wait a minute multiply no divided by num pt multiply by pi multiply by 2 should be the angle isn't it think so so this will give you a value in between zero to number point number minus one then if you multiply by pi multiplied by two you should be able to get a volume between zero to 360 degrees and then you also need to calculate the radius as well based on those values the radius itself so this so the final radius is can be divided by the total number of points i think then multiply by i doesn't it maybe i should do a negative one for this thing okay and probably i would need to make it as a float value just in case okay so let's see if this is going to work so this is the radius this is an angle the only thing that i need now is to use this angle to rotate some point informations let's create a vector value let's go as pass create a x coordinate using the radius then let's also create a rotational matrix starting by creating a identity matrix rotating it by the angle that i have just created using a y axis like this then rotate the vector using this matrix and as a result the point position should be at the position of the spiral hopefully let's see that's what i assume nope okay looks like i do have some spiral curve but not really a shape that i was looking for okay something is missing i guess so let's see what i what i what am i missing so i have the radius of the angle okay this should be something something wrong with this one so i have this angle this is also this is correct but the thing is that if i do this i should also add this by yeah this is not really correct what i need to do here is to okay let's think should be i divided by a number point multiplied by a number rotation okay multiply by pi multiply by two multiplied by number of rotation is it doesn't really change doesn't really make any difference okay i think i'm missing here maybe i don't really need this one oops nope okay obviously i am missing something uh let's see ah why did i write rad here again this should be angle okay then this case i should rewrite this angle again so where was i the angle should be i number pt okay and multiply by no divided by number pt multiply by pi multiply by two really okay is this correct maybe because i have number of pt so one rotation contains 10 points so this looks correct so let's try to connect all those points as a spiral curve and see if i have the shape that i want okay looks correct so starting from the center points creating a spiral curve like these with the constant distance and the radius of the final point of the spiral should be equal to the final radius that i set here 10. so let's see let's see it by creating a circle let's copy this radius and create the circle as a polygon set it at x z plane with the uniform scale using the same radius maybe same divisions like 10 points and yeah looks correct let's make this open arc okay so looks correct one things i can also copy this number of points to this one right here now the spiral seems a bit too low res right now so let's make this more high-res by increasing this number i don't know 36 yep good enough okay and also you can control how many like numbers of turns you want or how many rotation you want by controlling this number i make this 50 you have 50 turns 20 10 yeah parametrically looks great and by merging all these two looks correct looks good all right so so far so good uh let's also right now it looks a bit too low res as well i mean you could still increase this value here to make it high res and later on i might want to control these values so let's make this parameterized by you creating a new node having all the parameters that i want to control later just like i always do so one of the parameter that i want is the radius the number of rotation and number of points for per rotation so spiral radius and num rotation and also number of point per rotation all right and let's also set the maximum values so the number of per points per rotation the maximum could be 100 this can also be 100 spiral radius can be 10 all right now i should be able to control these stuff prometrically okay looks good looks good now now thing is that right now the point distribution in terms of the point distribution where the point is close to the center you have more density and if you go outside you have less density here so i want to make it a bit more equally distributed in terms of the points so let me resample this at this point by creating a resample node and using an option called interpolating curve so that i will be able to interpolate between the current point positions with a specific number of points now let's just use the parameter that i have right now which is this number of rotation number of points as the total number of points so i'm going to copy this parameter and go back to this one uncheck maximum segment lengths and instead i'm going to check this maximum segments to control the number of points after the a resampling also copy this value as well so multiply these two values use it as a final point number and now you have equally distributed point positions which is a bit important when you when it gets to control the point i mean the curve offset controlled by the intensity of the geometry okay right now it's a bit too low as on the center so let's increase a bit more doesn't change that much okay let's say this let's say this is okay all right for now all right and the next thing i like to do is to create some um strategy or create some system in order to create an offset curve from the original curve based on the intensity on top of this curve so to do that i am just going to like copy the original curve the one that i have right now here several times then depending on the i don't know how much intensity you want to view or how much contrast you want to show in terms of the visualization i i should be able to change the number of copying and that will change how many curves you see when it's been offsetted and more curve you have more white area you see it's shown as a more brighter area or maybe a darker area so to do that uh to in order to copy the curve multiple times i guess there are a bunch of ways to do that i'm just going to use a for each loop with the number and just by connecting this one you should be able to copy the same primitive 10 times like this now for each primitive i would i would also like to set some id for each primitive so that i know later that which primitive i'm working on working with and depending on those let's say id of the primitive i can control how much offset that i want to do for those curve so i'm going to use the primitive wrangle to set an id derived from the iteration it should be easy i'm just gonna copy the primitive um i'm just going to copy the iteration value which is in the detail attribute which is this one so i add id is equal to detail iteration just like that and as a result you should be able to get 10 primitive with an id from zero to nine now i think it's a good idea to control how many iterations you wanna have so let's have that as a parameter small copying this value here oops copying this value here number of let's say layers from 1 to 10 maybe 10 is a bit too much for testing so let's stop from four right okay now next thing i like to do is to actually rotate the spiral so that it looks like it's going from outside to inside or inside the outside which is which is done pretty easily i'm just going to i can just use a transform node but instead of using transform nano i'm going to use a point wrangle for two reasons to rotate the geometry one of the reason is that because it can be faster using point wrangle in order just just to rotate the geometry and another reason is because i also want to rotate another vector value which is a tangent vector value which is going to be created using this resample node okay this tangent u is a tangent vector at each point in the tangent direction which is necessary later on in order to control the offset of the curve so let's have that applied to each point like this like these and then what you want to do is to rotate the point position as well as this tangent vector value so let's do this using the center point as the rotational center so i'm going to create a rotational matrix starting from my creating identity matrix then rotate the matrix using a some parameter that i might be able to control from outside and goal and in order to make it as animation might be a good idea to just multiply this by multiply this by some frame value like this okay then use y axis for the rotational axis now rotate the point position with this matrix as well as rotating the tangent hue vector value using the same matrix to rotate okay i get some errors what is it unexpected something something is not closed okay maybe this one all right so let's promote the angle and this shrink this this angle should be should be a frame degrees value so let's have that parametrized as well rotating angle should this rotating angle should also be used as a speed so i'm gonna just say rotating angle speed right which is in between negative 180 degrees to 100 degrees all right so let's copy this value paste it right here and see what happens okay i'm gonna say let's say if i say 90 and if i play it looks a bit too fast if i say 50 you can see that if you look closely the curve seems like going from outside to inside going from outside word if it becomes negative it goes the other direction yeah it's interesting and you know i don't really like the edge being like this so that's another reason why i have the circle for a final radius if you combine the circle with this spiral then you have less glitches on the outside okay looks great looks great all right so in terms of the current conditions looks great let's make it a bit slower like minus 30 degrees okay it's okay for now now the next thing i'd like to do is to actually using the rotational box together with this curve to actually offset each curve which is currently at the same positions but would like to offset each curve based on the intensity and then the value the offset value should be controlled by how bright it is if you look the geometry from the top view okay in order to get the brightness of the box uh one way is to create a like a fake lighting or fake directional light and calculate the fake intensity on top of each primitive and use that prim intensity to use it for a offset value for each points for this disk so let's try to do that now the box size is a bit too small compared to the spiral so let's make this a bit more larger like these okay okay looks good now let's do this by let's connect all those two informations together by using a point wrangle so the one that i want to control is these curve right now i have four primitive then use this box as a guide i also want to control the i want to i also want to calculate the intensity of the primitive for this one so let's also do that i can do it outside or just do it at the same time maybe let's just do it in the different positions as a separate function so that i can see it clearly what's going on here so let's first create a intensity value here right now this has a default shading which looks a bit confusing to test out so i'm going to make this flat shaded by make this flat shade i can go this one yeah so right now everything is a single color so right it's a bit easier to test out this fake intensity that i'm going to calculate now so first thing first let's create a fake directional light i can just use a the normal directional light like this one for a real direction or you can try to create your own directional light setup like creating a line like this one and try to rotate this or set the direction of this line negative one negative one like this okay so i let's assume that the direction of this light is a actual direction of the lighting let's say i'm gonna use this one as a direction so this can also be parameterized i guess the direction of this line so let's copy this parameter or not go in back to the controller i'm going to create a vector values vector value float vector 3. right direction and just cop let's say -1 -1 1 and copy this parameter and use it right here so that i can also control the direction of the light later okay now together with this line and the box i should be able to calculate the fake intensity so let's do this i'm going to use the primitive wrangle i'm going to calculate the intensity per faces per primitive so primitive wrangle calculate intensity now in order to calculate intensity i can just use the dot product pretty easy you just need to calculate the dot product between this vector this directional vector and the normal direction of each faces now currently each face doesn't really have a normal direction so let's create that using normal node with the primitive option now i am ready to calculate the dot product let's do this so first thing first let's get the directional value from this line which is from the first point of this line to second point of this line so i need to get two points from this second input in order to calculate the direction so position one light position one is zero light position two one and then the light direction is light position two minus light position one and i can just normalize this so this is the light direction and for a primitive normal you can just use at n now together with using those value together you can just calculate the dot product just calculate dot product using dot function like this right and now you should be able to use this as a intensity value as is so let's test this out let's just try to apply this as a color first of all to see how it looks like oops just change the camera okay let me just just did something wrong here oops what happened okay something weird okay how do i fix this okay i don't like it i like it i like it what's happening here oops okay that's did something stupid okay should be now okay sorry for that uh where was i so i have this direction now it looks like the other way around so right now i'm using dot product but it seems like the where the light should uh touched to the faces becomes black so i think you have to use the negative direction either for light direction or the normal direction so let's say i'm gonna make the light direction negative okay so where the light is not touching it becomes all black because these are the negative values less than zero and the one that is brighter grayish is where you have a positive values okay so the one yet you have negative value you can just say you can just clamp it to zero i think so dot dot val is equal to a max dot file zero because you don't really need a negative value for our intensity okay now let's have this dot value applied to each primitive as an intensity value i'm going to call this in 10 ct right and let's also colorize this with the dot value as well so that will be easy to see the shading okay so looking from the top view what i would like to see is based on these shading i would like to change the offset of these curve okay so if it's brighter you have more offset if it's darker you have less offset if it's black or if if it doesn't really touch with these objects you have no offset like that okay so that's what i want and that's what i'm gonna do so i'm going to refer i'm going to control these spiral curve and put it into the first input to the point wrangle then connect this primitive with the intensity value on each primitive to the second input let's call this offset all right now this should be the last coding part for today i think um first thing first i am going to calculate the intersections for each point on the spiral to see if it if these points is going to touch the box above okay so in order to do it i'm just going to create a points which is way upward in this space then create the ray to the bottom direction to the negative y direction and if it touches then means you have an intersections then that means you could also get the intensity value from the primitive if it doesn't really if it really didn't touch anything then you get zero intensity so let's first create a original positions for a ray testing which can be from the current point position plus going upward way upward like thousand then calculate the intersection by using an intersect function for a second input from the original positions and you wanna throw a ray to the bottom direction so minus around 2 000 then as a result you should be able to get several values one is the intersected point position one is the uv like this now you don't really need the intersected point position or uv you just need this primitive number in order to get the intensity so once you get this primitive if it's negative then that means you didn't really get any intensity so you can just set you can you can just skip offsetting the curve so if prim is positive only if it is primitive then you can try to offset the curve all right now let's get the intensity value using prem from second input intensity intensity at prem okay and based on the id of the prim this primitive of the spiral since currently i have four primitive at the same positions so based on those ideas i want to change the how much offset that i want to do for each primitive if the id is 0 then i don't want to offset for that curve if it's if the id is equal to 1 then i want to do a little bit of offset if it's if the id is equal to two then twice as much as offset from the first one and so on so based on the idea i want to change the total offset values okay so let's get this id value and in order to get the id value you do need to get the primitive number which belongs to this current point number right here so to do that let's get that value somewhere around here and on prem number is equal to point prims pt num get the first one since the point only belongs to one primitive yeah now it's time to get the id get the primitive id attribute from the ohm primitive number now actually the on primitive number is equal to id in this case so maybe you can just use this one as an id value but just in case all right now you also want to set the total offset value like what's the maximum offset you want to do for each curve so let's have that as a parameter max offset and that should be in between zero to this thickness and this thickness should be able to estimate it by using those parameters that i have set so let's think what's the uh what's this offset here so i have the final radius here and i have the number of rotations so pretty simple you just need to divide this spiral radius by the number of rotation that should be the maximum offset value okay so let's copy this and bring this to wrangle not this one this one so let's have that right here a final radius as well as a total rotation number or rod number and copied it copied from the parameter this one as well okay so the max offset can be a ratio between 0 to 1 to control how many percentage of these thickness you want to use as a maximum offset from zero to one okay so if it's one then you are using the full thickness if it's 0.5 you're just using the half size and so on let's say 0.5 for now and the actual let's bring this max offset right here so the actual offset actual maximum offset is actual maximum offset is actually a final radius divided by the number of rotation multiplied by the max offset okay makes sense and then now it is time to convert the intensity into the actual offset value using also an id value here okay so that and we also need to get the direction in which direction the our point should be offset to for example for this point i want to move to this direction or this point i want to move to this direction and to do that you do need to have a tangent vector value now the tangent vector value is currently in this direction so you want to rotate this tangent vector 90 degrees so they can go this way or this way so let's do that first let's get the tangent vector which is tangent u then let's also create a rotational matrix again in order to rotate these tangent vector rotate 90 degrees using y-axis and then rotate the tangent vector value like this all right now it's time to actually use this directional value together with this intensity and an id and a maximum offset right here to actually given a final offset value so final offset value offset direction is equal to first of all a tangent vector value rotated tangent vector value multiplied by a max offset and multiply by a id multiplied by an intensity divided by the maximum number the total number of the primitive so in primitives minus one okay that should do it i think oops and semicolon hopefully this will do and then finally you can just move the point with this offset direction now you are starting to see the point has been offset the curve has been offset based on the the top the geometry on top based on its intensity and you can see that the shading has been made shading has been transferred as the opposite value okay and if i make this equal to one you are using the full curve thickness there's no final offset and i think it's working seems like i i do have a little bit more spaces here but doesn't really matter okay now one thing i don't really like is this edge conditions right here it's a bit too straight so let's make this blurred or smoothen out a little bit by using a attribute blur node so attribute blur and uncheck the pinned water points and you can just control this blurring iterations to make smooth similar as you want maybe one is pretty much enough or make it more smoother if you want to have more blurred image and so on i'll control this step size yep that should do it okay maybe this can also be parameterized maybe a blurring iterations or step size i'm just gonna parameterize this blurring iterations since that that's looks like a quick a value to change so i'm just going to open up the controller again drag and drop this blur iterations from zero to i know five all right and reconnect this to the merge and there you go you now have a projected geometry on top of the disk just like this simple as it is and the geometry that is going to be on top of this disc it's not really restricted to the box but could be any kind of geometry you can just switch this to any thing you want let's say if you want to rotate the test geometry like rubber toy making this a little bit bigger rotating with the same amount switch this to the rubber toy just like that just work just fine and since this is all procedural you can just try to see what makes it different using all those parameters changed if you have more layers you have more densities if you have less wait a minute i think i'm missing one parameter to promote which is this value here max offset or offset ratio should i say let's bring that as well let's bring this somewhere around here offset ratio and let's make this like half size so you can see that it is controlling the density of this shading right i think it's working pretty well and another um additional thing i can set as an additional parameter could be a how you can control the intensity like currently i'm just using the linear intensity value retrieved from the dot product but you can use a function like power to control the intensity to make it to have more contrast if the brighter area becomes more brighter the darker area becomes more darker and so on let's test this out so if you are making the power if it's equal to one then that's the linear value but if it's make if you make this two then you have more contrast between the darker area and the brighter area in terms of the intensity and if you make it 4 you have more contrast and if you make it smaller than one then you have less contrast between the the intensities and so on this might be addition this could be additional interesting parameters to control with so let's have that as additional parameter i'm just gonna call in intensity power from zero to five all right that's about it for today i think i think this was is enough to follow it i think not much to do for today let me know if you have any questions and or any comments and let me know if you how you think about the this process the process itself is pretty simple i guess let me also control some different values here okay so if you don't have any questions i would like i'm just gonna end this tutorial right here for today hope you liked it and as always after this after the after this live stream live stream it's ended i'm going to upload the files i'm going to upload the file to the github and also paste the link to the video description page of this youtube so that you can download the file for your reference and also i'm going to archive the live stream so that it can be watched later all right so that's about it for today i think i do like the effect that i'm seeing with this simple setup and hopefully you do as well this one is pretty nice if you have tons of rotations and let's also speed this up make this negative yep like it okay all right okay thank you thank you all for watching the tutorial again as well always and hopefully i'll be able to do the tutorial next week as well recently i uh it's a bit hard to do on wednesday night so maybe i am planning to shift the day to a saturday night instead it'll be more easier for me to do all right so thank you and i'm also doing the patreon page for myself so if you're interested in supporting me that would also be great you can go the to the page from the same video description page of this youtube okay that's about it thank you very much and see you next week bye night
Info
Channel: Junichiro Horikawa
Views: 971
Rating: 5 out of 5
Keywords: houdini, sidefx, live, tutorial, procedural, procedural modeling, parametric modeling, parametric design, parametric, fabrication, digital design, computational design, 3d, design, isosurface, lattice, structure, 3d modeling, modeling, computational, generative, line drawing, drawing, illustration, fractal, reaction diffusion, celullar automata, simulation, trail, particle, vfx, mitosis, magnetic field, field, volume, rendering, computer graphics, visualization, algorithm, motion graphics, graphics, remesh, quad
Id: 4I9N2aJo4c4
Channel Id: undefined
Length: 67min 30sec (4050 seconds)
Published: Sat Oct 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.