YTread Logo
YTread Logo

Houdini Algorithmic Live #042 - Night Cityscape with Wave Function Collapse

May 02, 2024
to do is simply create a new position and set a zero height, then create a new point t at the zero point and pause and use those points to create a primitive, add a new primitive and primi, add primi 0 poly and add vertex at this newly created point on this empty primitive, now all the height seams are equal or not, that difference, I mean, there are some differences here, but actually it's not a big difference, but by increasing this value, you will get to be able to see more differences depending on the area, okay, that looks good, so the next thing you need to do is create a side of this building, I guess, so we will also do that and to do that you need to have a list of points which is this along with the pts right here these are the original points here this is the newly created points and by having two arrays of points you will be able to create the site using the for loop so in pts add using the array so yes I have a question for why not use polyextrusion with dscale control, that's all because I would, like I said.
houdini algorithmic live 042   night cityscape with wave function collapse
I wanted to create a window on the side, at the same time I create the extrusions now using some additional attributes that I'm going to create later, so that's the reason, but I guess you could do it too, maybe with some of the process well, let's do it this way, I mean, if you know the easy way to do it, yeah, you better do it that way and I guess I'm doing it the hard way, the hardest way, okay? Am I practicing the Vex? Also, I guess that's okay, so what I want to do now is add or append this npt that I created to the new array.
houdini algorithmic live 042   night cityscape with wave function collapse

More Interesting Facts About,

houdini algorithmic live 042 night cityscape with wave function collapse...

Now we are going to create a site using a for loop and then access four points to create the side. pt1 and pt2 are from sts i plus one and calculate the rest using the sts. pt3 will come from the mpts i plus a combined module and pts y in pt4 and pts i and I think those are the four points that I need to create each of the side for these squares, so after I have that I can create a permanent primitive polygon, let's call this cypoly in crim xero poly pt1 p2pt3 and pt4, okay, now I created the extrusion like this, but this is not enough actually what I wanted.
houdini algorithmic live 042   night cityscape with wave function collapse
What you need to do is create a window-like shape that looks like this if you zoom in, so if I look at this geometry closely, it's like a silhouette, but it actually has a grid of windows on each face of the building, so just having one full side for each building is not enough, I have to divide this building into layers and also in vertical direction to create a bunch of windows, okay, so let's try to do it using the same vex

function

s. Now first of all I would like to define the number of layers in the height direction and for this example I'm just going to keep the layer height for each of the layer heights to be one equal to one that has the same size. like the single grid size of the grid, but you can make it varied using random, but for now I will make the height one, which means that this height itself will be the number of layers that are now done in the calculation.
houdini algorithmic live 042   night cityscape with wave function collapse
The result of this is not actually an integer, so in order to use each height, the height of each layer is b1. First, I'm going to convert it to an integer value using stamp, round, end, or floor.

function

s I'm still going to use to get the roof value from the flow value, so now the height of the building will be limited between zero and some integer value. Okay, the next thing I would like to do is create the point of each layer using this height. value as a number of layers, okay, so let's do it and to do that I'm going to create another loop besides this one, so first of all I'm going to hide this one, okay and I'm going to use create a new loop, let's use n as the attribute. and h will be the number of layers, okay and since I already have the first layers, okay, let's hide them too.
Okay, let's hide these top planes as well and currently I only have the one on the bottom, so what do I want to do? is to copy this point, the point grid up on multiple layers, so I already have the bottom one, so I'm going to save these things from one that I'm going to use as height and then smaller. than or equals okay, so use this type of conditions right now. I'm going to copy all of these values ​​here into this one, okay, and then let's create a point here and see what it does. I don't really need the primitive for the top. so I'm going to delete this and this one, okay, and I think I also need to set the height for each layer that is defined here, so I need to replace this h with n, which is this one, so let's set it to n, okay. so now I have a bunch of points explaining the layers of a layer for the building.
OK OK. I have a question: Your Twitter is primarily for a Japanese audience. Well, I'm not sure I tend to tweet in Japanese, sometimes in English, but since I'm Japanese and Twitter is about tweeting what's on your mind, I guess I think in Japanese, so that's what I tweet, right? Where was it? The next thing I would like to do is create a face for each of the layers like this this and this and this and so on okay, that's what I want to do next, using all the information from those points now to do that, you will see this is if you look at the site if you focus on the side this is a 2D grid and to create a face for each point using all those points you first need to get the horizontal point grid and also the vertical point grid.
Unfortunately, there are no double array structures in vex like you. You may already know this, and if you have those kinds of structures, it will be quite easy to build this kind of 2D grid using preserved arrays, but since we don't have that, I'm going to try this. The next attempt is to use new data structures introduced since Houdini 18 0.5, what is it called dictionary? So I'll use that dictionary as a practice as well to use it as a 2D array or a multidimensional array. Okay, let's do it. So first of all, what I would like to do is create a dictionary value for each of the layers, so that the first layer for the first layer for the second layer, the third layer and so on and for each of the layer values ​​I'm going to store the array just like I did for npts and pts okay so the dictionary works for each layer and inside the dictionary each of the keys I'm going to store the set of pts and npts to create a site Like we did last time, I hope.
Now it makes sense, let's try to think what kind of structures we could make. There is some limitation with the dictionary. You could have an array value inside a dictionary as a value, but you can't have an array of vectors. You can only have area. of float, integer or string values, so you can't use a vector value, which means you can't create a positions area, but I need position information to create side information side faces, so I'm going to do the what I am going to do. What needs to be done is to deconstruct the position of the point in x, y and z.
Okay, this might be cumbersome, it might sound really cumbersome and there might be a better way to do this without using dictionaries, but let's try it to see if we can use this dictionary in real practice. so first I'm going to create a dictionary value using the dict layer okay and let's set the wait a minute maybe I should create a well let's call it the name of the root dictionary like um pts stick which since we're going to store the points . information here and initially we only have the bottom plane here so I'm going to start with 0 which I'm going to use as an indicator to define which layer we're on so zero means this on the first layer first the bottom layer that's drawn on black right now is fine and for this one I'm going to store some additional values ​​like uh, let's call this layer and I'm going to create another dictionary called layer that has various information to define this.
The values ​​one is the point number and the other is the point position information for each of the points, so another dictionary to start with first. I have this point number as the key and pts, which is the point array of the point list for the bottom, which is this. and another key is the position of the point for the x, y and z coordinates, so the x for point x and expect is that correct. No, we can't use this one because we're in the primitive contention, so we have to retrieve the point attribute here, okay, on that. case we need a float array x load the array y for the point and the float array z.
I'm going to loop through all the points number point number get the point information then get the position of each point for the primitive and then add this value x to array xs and do the same for y and z to initialize this array to be the same size with these sts, okay, so ys s position c in position y now I can have a key for x, y and z, all good Okay, starting to get a little complex, here it will start to make sense later. Okay, now that I have this layer that is supposed to be created for each layer and actually this is for the first layer and I'm going to use this first layer as an initial value for this root dictionary, now let's apply and see if I have any mistake.
No, it looks good. Right now I've just created the first layer, so the next thing I'd like to do is create a layout for the layer information. all these newly created points are okay and on each layer we are using this for loop so this is where we want to create another layer uh so right after we have calculated or created these npts I'm going to create a new layer let's name it . dict and layer set, okay I have a question, I just got here and realized I missed almost an hour of the stream, the stream will be uploaded to watch later, yeah, um, this stream, the stream on

live

will be recorded and also archived so that you can watch it any time you want later and I will also upload the file that I created during the course during the sessions after you have finished this and you can access it from the description page of the video, so don't worry.
Don't worry about that, it's fine now for the layers above, the layers that have been created using the for loop. I'm going to need to have the same key, the point number x, y, z, so for the point number this is going to be npts that I just created right here for the xs, ys and zs, we need to create similar things like the ones we made here inside this loop, so I'm going to copy this one and maybe paste it like on the right side. after this mpts array and let's also rename these attributes to nx e y z because this same name has already been used here and we also need to do some different things by doing here by adding the x and z coordinate value to these float arrays so let's do do that right after here, okay, and the name of the array was nxs, yz and zs, and we also need to rename this position to end pause and pause and pause, what is this is the position for each layer to each point? now apply Oops now it looks like I have some errors okay this is the one so I need to set the I need to create the layer in the new dictionary layers for x which will be n x s for y e y s y 4 d z and z okay right now after to do it, what do I need to add this layer as additional with the additional key to this root dictionary called ptsdict?
Previously I was using 0 as the key for the bottom for another one that I'm going to use. the key comes from the number of layers, which is equivalent to this final value and to use the dictionary you need to change this to a string, so I'm going to change this value n, which is an integer, to a string and use it as the key and store in a specific key what i can do with name pdf dict and change the value n to string using iq a, then store this and overlay it on that dictionary key, all good, apply and check for errors, ok, That looks good.
Now the preparation is done to be able to access the information necessary to create the faces. That was very long. The next thing I need to do is access each of the data points in this dictionary to create faces just like I did here. for each of the bullet points, okay, so let's do this. First of all, I'm going to access each of the dictionary values ​​and add or create the faces and the number of layers that I have to refer to if we have one. two three four five six seven eight layers so we only need to go through seven iterations, that's because we're going to use the first layer and the second layer to create the face, so if you have eight points, you only have seven faces, so that's one reason we need seven layers, which is the number of values ​​in the dictionary minus one, so let's use the lengths of the for loop now until the length of the points stick minus one, okay, let's move on to the next thing.
What I would like to do is access the information from this layer for n equals uh, the integer equals n and also n plus one, so player one is pts dict and layer layered 2 pts dict n plus 1 modulo length pts stick or maybe we don't need this because we don't need to loop through the array okay, and we also need to change this n into a string since the key is in a string now that we have two layers. we can accesseach of the layers to create faces now just to create the face we can only access the pts information which is inside the pt num key so let's make it so that the int array pts1 is the layer layer 1 pt num and pts 2 layer 2 pt num the same key okay now that I have two areas we could use this code we used to create the faces between two point arrays and one was for pts2 and one was for pts so pts1 and pts2 pts2 so replace these numbers and this one also pts1 and this can be pts2 okay so let's see how this is applied and yes so the side is created successfully and if you notice if it shows the edges using soft shading while you shade it you have created those valleys squares that look good now, what I want to do next is create window faces and if I look at this graph I'm referring to, some of the windows are wide in the x direction, some windows are long in the y direction. , so I want to differentiate the size of the window that looks like this and also some windows look very long in the horizontal direction, so that might also be something I can control later, but for now I would like to control the size first of the window into a single grid.
So to do that, first of all, we could try to create a window of uniform scaled size from each of these. the faces are fine and you can do this by accessing the one that I have already applied as a dictionary value, which is this x yy z value, which is the x value here for the y x y y z value for each of the points to create the faces and use that information to calculate the new position of the point to create a window size now if you just want to have a similar uniform scale. window, it's probably better to use polyextrusion, but if you want to differentiate the x and y value for each of the faces or each of the building controllers using the attribute with vex might make more sense, okay, so let's try to do it so that the position where I can create those points um or for the windows it could be somewhere around here and maybe somewhere right after we have the point numbers here, so all you want to do is get the point information, the position of the point, the position information of the corresponding point. to these values ​​here, but we can't use this point function to use pt1 and pt2 to access an attribute a in p, that's because those points were previously created using this for loop and didn't really exist previously, so if I try to access each of the points like this, you can only access the phone information that existed previously, which was the bottom, you cannot access these points that occurred procedurally within the code via this point function I already tried and didn't do it. works fine so that's one of the reasons why i stored this x value which is to store the position of the point where we have created the new point okay so let's retrieve that x, y and z position to create a new point , so let's uh uh, first let's create a vector, pass one or not, it's actually a series of float numbers, so I have to do this so that a x s one is layer one x float x s 2 is layer 2 x y do the same for y and z, so y y and z and the key is also z and y, all now, uh, inside the for loop, since the size and length of this array is the same as array x or any of the arrays, so we can access each of the arrays with this pt number correctly. here to get the position of the point so create a vector plus one that corresponds to this using set y for the pos one that comes from pts one that corresponds to x s one y s one y z s one so I'm going to copy this one xs one y inside the index which should be equal to this here and since this index is a bit long, let's create the shortcut for the indexes, so if let's say ID 1 is i and ID 2 is equal to this value here and We will replace this with id 1 92 92 and id1.
Right now, do the same thing with this xs ys1 id1 cs1 id1. Alright, that's for position one. Do the same for a position two, three, four, two, 3, 4, and this should be it. id 2 2 2 2 2 2 and this strip 2 3 two three two three and four and four Oops, no, I think I made a mistake, um, this should be xs1 xs1 xs1 2 2 yeah, like these, okay, it looks like a Bit confusing, but I hope it's okay. to have some errors here, okay, where are the candidates? int float vector okay, so where is where I went wrong? It's 40 yeah, okay, so this one sounds bad, let's see, let me give it to you, okay, this should be a comma, okay, so I need to replace all of this with a comma, okay, now that I have a position for each one of the faces to create a square face on the side, now we can start creating a window, now let's try the uniform size, we can get the center position back. of these four points by adding all those positions and dividing them by four so let's make the center position of the first vector be plus one plus cos two plus three plus cos four divided by four which will be the position of the center point now use the position of the point center to create a scaled point for each side, now each of the points, the vertices, which is this now.
It might be better to do it in a loop as creating one by one requires a lot of coding, so what would I like to do? The next thing is to create a vector array to store all these positions. I'm going to name this as w positions and inside the array I'm going to store all these point numbers, point positions, okay, now let's look at all of these using another loop. Ok, I realize the code starts to get really long just to make it flexible, but I guess it will pay off in the end. Okay, for position 2, I would like to get the Do I need?
No, actually I don't need to get the second one I just need to get the position of the first point or the range of them and then what I'm going to do is scale each of the points based on the position of the center point, so let's say that the new window position will be a center. position plus a position w minus the center position multiplied by some multiplication value multiplier multiplication factor like point five will make half size squares should make half size squares points uh positions now, after you have recovered the point, new point position, now I can create a new point in right here, wpt is equal to adding the zero point with new window positions, okay, if I look carefully, if I show the point, the new point was created inside of a face and if I change this point five to something different like point three, now I can be able to uniformly scale the window size now I don't want to, I don't actually want to relate this window size based on uniform scaling, I want to differentiate the value of the horizontal direction plus the vertical direction, so I can't just do something like this, but you need to make it a little more flexible so you can differentiate the scale for the 2d or xc direction and the y direction.
Now, to do that, let's say we have two values, one for the horizontal scale. let's say 0.3 for the random value and for the vertical let's say 0.7 is fine and let's try to use both the values ​​to scale the point in the horizontal direction and the vertical direction. Now, to do that, we need to deconstruct these directional vectors into x, y, z and multiply each of the coordinates with these values, so first I'm going to create the directional value that is in each pass minus c pos and I'm going to recreate this value directional using these scalar values ​​so that any direction is equal to the one set for wd here point third gear point wide there point z and each of the x and z values ​​I'm going to multiply any of the y values ​​since we are dealing with the xc plane as a plane similar to the floor and the y direction as gravity direction, I am I'm going to multiply the hs that will be used for the scale for the xc direction, so I'm going to multiply by x and z and for y I'm going to multiply by v s.
Now I'm going to replace this one. with w direction and see how it goes well, now the scale has been changed based on these two values ​​for this point and currently the horizontal scale which in this case became 0.3, so this is the size of this point inwards using like a window with a size of thirty percent of this original length for height, this is seventy percent height, okay, so I can change that to 0.1 to make it smaller and vertical and so now, that looks well later. We'll do it as random values ​​for each of the y and What I have to do is open or create borders to be able to change the color of this window.
To do this I need to create four side faces using this point, this point, this point and this point for each of the sides. So in total we need four boxes, our polygon for the window. Well, that means we need to do another for loop, which in this case we already have the point numbers here, but we don't have this point number applied in an array. which is necessary to make the comparison with the connection with these point numbers, the list of points retrieved right here, which is the information of these points, so let's create another array and wpts wpts to store all the point numbers that were have created for the window which is here wpts wpt and along with this we need the original point which are the external point numbers which are stored in the array for convenience and all the points of the array and since these points are not yet in the area we need to store that too and for these I can just say pt1 pd2 pt3 and pt4, okay now that we have to set up the array it's time to create the side faces so I won't do another for loop through the wps, okay and I get the opt option first and also wpt from the wpts now for this one I need to have the next iterations and the next index as we are looping through those four points but we need to have the next point information to create the side like Okay, so let's call this the first option one and then the next one I'll be t2 pts t plus a length wpts, so this should be t for any pd1 and wpt2 t plus a module of lengths wpts, okay, we're almost done.
We're almost ready for the window. Now we have those four points to create the side. We can say prim add trim zero poly. Go for one op t2 or wpt2 wpt1 and see how it goes. Now, did you create it aside? I think so, but it already has it. the original faces here, which are not really needed anymore, which one is this, so let's delete this one and here you go, the same rule has been applied to all the faces of each building. It looks a little strange because the entire building is the same width. and height values, but it is working fine.
I would like to also have this inner area of ​​the window as a polygon and then convert it to a different group so I can access this later to set the colors, so let's create that and That will be easy because these points are stored in these wpts, we can use this to create another polygon, so let's show these points again for the side, but instead of using those point numbers, I'll use these wpts as a list. and here you go, you have created more internal polygons and I'm also going to set the group for this internal window polygon using set prem group zero window uh, let's call this w poly w poly two one and the one next to it let's name, let's set this group as a wall, so set the frame group as zero wall, okay, now finally, I don't want to make all these windows, how to share the same values ​​for each of the buildings, I want to make the difference for each of the building, so let's create some random values ​​and for each of the faces, to do that we could go to the top of the code and create two random values, one for the horizontal value, let's say hs equals random based on the position of the spot. of the primitive plus some constant values ​​and since this will create a random between zero and one and we don't really want to have a zero value of one because that will make the window too small or too large, so let's set this value to some with the values minimums here, so I'm going to use the clamp and let's also have this minimum value as a parameter, so scale the half scale and clamp this with a minimum scale as well as with the minimum scale of one, do the same for the bs, but This time I'm going to change the initial value.
I mean, you can also parameterize this to change and see some different values ​​of the building, but I'll make it constant for now. Let's also replace this comment. This hsn. vs out and now all those windows are using the different sizes, let's also promote the main scale and raise it to control the clamp value, maybe point three is a good number, okay, that looks good, now that was a lot of code , but I think I've done what I wanted to do now. I'm still missing the top here now, since we've done all this with the code, let's just create the top with the code as well, which isn't I think it's hard to do, so what we need to do is retrieve the number of the list of points for the last layers and obtain the information of theright, okay, what if I do this dot product anyway?
I mean, okay, now, ah, okay, I know the problem is because I'm using this in pt num inside a primitive dispute that was a problem, okay, I have to do it. fix this, this has to be the one I want to delete, so the condition must be correct. The one I wanted to delete is the midpoint of these three points, so this point 2 should be point two, now I think it worked. Okay, that looks good now, no, I don't actually want to remove everything, every point on each side, but I actually want to remove some of the points to keep the window size varied, so that there are other random values ​​that you can create within. this condition I can have another condition that says if it's random at p plus uh, I multiply it by some constant value plus some initial parameter is less than some other threshold value, let's say simplified threshold, simplify it and then delete it delete the point right now, let's promote those parameters that i have created one for the seed and one for the threshold if the simplification is set to one all the points in this all the side points will remove it if it is zero all the side points will be there okay but it will look good now. by just doing it, accepting and going back to extrusion you will be able to have a longer horizontal window size at some point, in some places, if you go back to the color that actually colors, now it looks like this and if I change the simplified zero back to the normal, but if I do it, if I make it bigger, then you'll have more larger horizontal size horizontal windows in some of the places, which makes the

night

scape pigeons a little more interesting.
Okay, let's keep this tip as 0.4. okay, it looks good now at this point, maybe you want to do it, I mean, I can go to the precision plan now, but maybe you also want to change the size of the layers for each of the buildings to make it a little more varied, so if I can go back to the extrusion and check where I set the height which was here, so what I can do is just change this value to some random related values ​​for each building. Now I can create a random value for each building, maybe. set the create height scale value of a layer using random again using some initial value now random creates the value from 0 to 1 but let's say I want to keep the layer height at 1 as default value and just multiplying it with some scalar volume, I would like to change some values ​​between one and some higher values, so let's say let's adjust or rescale this to the random value from 0 to 1 to 1.02 1.5 and multiply this value together with this final value here and let's see what happens now some of the buildings have more taller layers some of the buildings have smaller layers smaller height layers just a small change but it makes this a little more interesting now maybe you would like to parameterize this scalar value also so chf maximum layer height and set it to set the range from one to two okay it looks good now if you then set it to 1.5 as a different value okay now it's time to create a return to step initial to replace. this texture value with a procedural tile grid okay before I do that can I just check how do I check this again if I can do this without updating for each frame because no I don't think there's a way to ignore this being update for each frame.
Well there should be some options somewhere so I'm going to go back to this one and disable this file cache, it's going to calculate something now, the reason it updates every frame is because this time depends and each of the node maxes ok i think this is the problem here if yes if i look at this wafc initialize2 which is loading the texture this itself is time dependent so i guess this is this node this is the reason why which does this update every frame and I have no idea why this is time dependent, it doesn't really make sense does it? but we're going to replace this with the procedure grid, so it's not a big deal.
I guess I'll create this cache file for now and we'll try to replace this with a little procedural grid that looks like this. Well, what am I going to do? What I'm going to do is do some simple recursive divisions like um for the plane grid. First I'm going to create a grid like this and then I'm going to choose an edge, first one of the edges of this square and then let's say I choose this one. and the next thing I want to do is choose the points on the edge, use some random values, let's say this one here, so if I choose the points on the edge, what I'm going to do is create the perpendicular line with this edge up to the corner of this way and using this line to divide the polygon in two, okay, now what I'm going to do next is for each of the primitives that I'm going to choose, I'm going to choose again one of the edge for this primitive I'm going to say that I'm going to choose this edge right here and I'm going to choose this point and do the same process here for this primitive let's say I'm going to choose this edge here and do the same process like this and keep doing it to divide this polygon with some criteria.
Now I will check the length and area size and if the lens edge size and area are too small then I mean. if it is too big to keep dividing it, but if the size becomes too small just stop the division and then continue with the final result, so I would like to have this kind of limitation to set the smallest and smallest border size and the smallest area size to maintain. the limit to keep the offsets so that we don't have this kind of two small edged squares that we don't want to have as a building layer or building block, so let's do this on a single primitive layer or attribute layers or attribute wrangling or we could use a foliage feedback loop.
In this case, I'm going to use the 4h feedback appearance loop because there are some useful functions for the polygon, like polisplit, to split the polygon very easily. This one is okay, so I'm going to use the 4h number loop and I'm using it for each loop right here because that's because these operations are not going to be animated, so I would also choose the for each loop if the part that we're in. process is going to be animated, so I think it's a good idea to use a range node using vex because it's faster, but for these this is just the preparation part, so we don't need to worry about the speed type.
From the process so far, first of all, I'm going to set this up in a feedback loop, so let's set this to feed back every iteration and then let's set this to get feedback and start with an initial grid size without having grid lines, like this Let's set the columns and rows to 2x2 and we can also set the size of the grid. I'm going to say it, let's say, let's say I want to create a 20 by 20 grid. Okay, so 20 by 20 and also create a new controller in this point to store the parameter that I want to store, so okay, then I'm going to explain the things I'm going to explain now.
Oops, I forgot to change the window here. Okay, I guess I don't see the comment anymore. Not sure if anyone is still looking here um well I'm not sure maybe don't let me check if comments are being created. Well, maybe not, maybe it's okay, maybe there's no one listening right now, so I'm going in. My pace is fine, so where was I? What I wanted to do is use this for each loopback, a feedback loop to create a fillet for the polygon and I just set each order number for each end node to be feedback. on each iteration and for the fodder started, I set it up for feedback and also created this 20 by 20 grid and rows and columns in pairs.
I want to be able to control this size using some parameters, so let's create a parameter like integer size, let's say the maximum is 50 and let's start from 20 and copy this one, paste it here and put it here now, first let's do a division, like I said, I would like Pick one of the edges of the square, so let's do this. What I'm going to do is create the explicit split line. I'll do another loop or dispute. Okay, I'm going to use primitive contention and after a loop, you're currently going to be the first in the first loop.
You only have one primitive here, but after a second loop, you will have more primitive outputs from here, so I want to come to terms with each one. primitive independently, so I'm going to create another loop here which is for each primitive to deal with each primitive and for those that I can, I don't have to do it as a feedback loop but keep it as a merge iteration right now. for each primitive I would like to create a separating and dividing line and let's do it and I need some random values ​​to define which side and which position of the point on the edge, so let's have this iteration value from the first loop, maybe from the second. loop too, so I'll click on this, create a meta import node and connect this to the third input.
Okay, now let's call this dividing. First of all, I will retrieve all the point numbers like This I want to make sure that the point is any and the order of the points is clockwise or counterclockwise. Okay, now it has to be zero. In this case, if you start from the original grid like this, the order of the points is not what I want if you display. this point number starts from zero one and goes to diagonal places and goes to here and three, but actually I want the order of the points to be clockwise or counterclockwise because will be useful in this example in this case so first I go to sort the order of the points maybe I should do it inside a loop somewhere around here and make the order of the points based on the order of the vertices now the order of the points has become clockwise, that's fine now let's go back to the division function and see what I do.
I could do it, first of all, I can get the random side numbers back, but I actually like to set some criteria for which side to take, okay, so if we have a square like this and we have a solution like this and if we're working with this primitive. and this primitive, then I would like to get the longer edges than the smaller edges. If you take the smaller edge to choose a point, then you will have a more linear or narrower polygon when splitting the polygon, but I want to avoid that. So I would like to get the longer edges to create offsets to create this division, in this case, it's at some point here to make the size of these squares not too narrow.
Now it's based on your preference, but that's my preference now, let's do it, so where was I? That is the reason why I have also reordered or sorted the point number. Okay, to choose the longest edge I need, I first need to get the point position of each of the point positions and then calculate the lengths of each edge, so first I will create the array for the positions and access each one of the points and I will retrieve the point position of each of the point numbers and I will add this value in the vector matrix now after I have created the vector matrix I am going to access each of the vector positions using another for loop to calculate edges to calculate the edge, you need the neighboring point numbers, never the point number or the adjacent point. number, so the first is positioned at index i and by retrieving the position of the second point, which by using i plus one as an adjacent point and since this is a looping polygon, I'm going to calculate the modulus like I always do, now I have two points so I can calculate the lengths between those two, let's say let's call this l and calculate the distance between position one and position two, right now, maybe I can have another array to store this length value and add things l now I would like to get the longest um value right here from this length and since it's always a square value, um, but maybe not, there could be, yeah, since we're just dealing with the rectangle now, so We only have four sides. okay, and meaning that there are only two different lengths, one is smaller and the other is larger, okay and that is stored next to it inside the length array, so if you have shorter lengths in the first index, then the second index should have the correct longest value or vice versa. vice versa, if you have the longest value and the first index and the second index will be the shortest, that's fine, so keep that in mind and let's have an integer called index to choose from to define which index to choose, which edge index to choose and then calculate I would get the conditions if the second index inside the lens is bigger than the first index then I would like to use the second index so update this index to one; otherwise keep it at zero.
Thisthat if this is the relationship between the width and the columns and rows, it may need to be related to the font, that could be the reason is that I don't know how it will look like, yes, if I set it. to one one by two ah this one seems to work this way it seems to work but if I make the columns bigger and set the rows smaller this starts giving you a strange result I don't know why we're going to set it to just set it to square size , I assume that is how it is implemented using Python.
If you look at this, there's a Python note here, so I'm guessing this is the place where side effects have implemented this algorithm. Well, in terms of the parameter. this is good, what else to return to later node views? divide sort simplify okay, so those are parameters that I could change let's open the node control again another separator oops! no the label no the label okay and let's simplify it, let's unlock the binding parameters a little bit and then drag and drop them, wait a minute, this seed can come from this one I guess, but no, no, since this seed also changes the output for the

wave

function parameter, we need to differentiate this seed value because if I change this one, then the other one. um calculation for the

collapse

of the

wave

function would run another solver, so we need another initial value here, let's call this c2, let's set the range from zero to a thousand or you could just drag and drop this one, drag and drop this one, drag and let go, this, let's simplify in small. look set seat equal zero to thousand now what else extrusion so I have this power hs extrusion power this is the window okay I don't use this anymore so let's ignore that min sc so this is the minimum scale value for the window. size then minimum window scale scale okay, what else seed is okay for this seed?
I can copy the one here, so let's leave that for now. maximum layer height. well, that is the value to determine the layer height differences for each building from one to this maximum layer. is used as multiplication value so set the range from one to two that's ok ok apply except return to null node copy the initial value here and then paste it here ok and go to extrusion if you just want to display this as a drop shadow. building that could also be interesting it could be interesting to do that, what is this? We can have additional code here.
Well, first let me remove those hs and bs that I no longer use and then I will do this for each primitive. and for each point i can set some color related value or height related value where is the point creation? uh look for add point, okay, this is the position where I'm adding the point so I can add an attribute to this. point as call based on height, so new paths were defined point and divided by height where was the new pass? c plus wait a minute, okay, oh yeah, this here and using this h value so that the new position is divided by the maximum height. is the one I need and h which will be h multiplied by l what is the maximum lhs okay oops in wpt still so call the setpoint attribute call wpt uh and pause again right now if you just want to have a shaded color of ambient occlusion i can just update the color of the point using the ram from the attributes using the color now i think i have some problems with those points here, i think i need to look at the extrusion again, there should be another code adding a point, okay, like this that this is set point attribute add the same color call attribute to this npt and pass the point w, I mean, and pass the point y divided by h multiplied by lh.
Okay, now if I hide the wires, it will show you a clean, shaded building that also looks good based on the height. Now that was the side effect and we go back to the window and there's another parameter that you can set, one of which is based on the time period, so we don't really need to worry about the maximum minimum, well, I guess that's fine. with those values ​​constant, so I guess I just did it. I just transferred all the parameters I need to create this configuration. Okay, finally I'm going to make this darker and set the output size to 200 to make it large.
Enough already, some of the building looks too tall, so to reduce it I can go to this extrusion power and make this value lower, like 0.8, since this is based on the area of ​​the building. Well, maybe I could have another guy create a seed. change the seed, whoops, that's too much, that's too much now, this is because I think it's because it's more diagonally shaped and now this becomes a 2 square grid, that's not that interesting, let's go back here and see what will be the best parameter to make an interesting shape along with the diagonals, I mean not the diagonal, but with the L shape or the irregular shape, there is the ball.
What's up with these? I guess if we want to keep those structures more, we should also increase the current sample rate. We don't want this kind of overly long, linear thing, so first of all I'm going to increase the number for the minimum rectangle lengths to 2.7, then minimize the value for the combined iterations, increase some changes to some initial values, and then set the sample numbers to four, I still see some small edges, okay, now this looks good, so how is this going? How is this going? Since I changed the sample number to resend, uh, the calculation time becomes longer, much longer, now it doesn't look good.
It is not seen and what happens if I change this to three? is it still seen? Well, no, no, 2.5 seems too small to me, yes, it seems too small, so I should have more than two right here. This one looks good in terms of Oops. Okay, well, I see too much of a rectangular shape here. Now let me also check that it allows rotation and see if this changes a little bit. Well, now it seems a lot illegal, but a little better, but there are too many ladder shapes. Let's change the sample to four again, well maybe that's not my b, that looks better, okay, that looks too high, but I can reduce it by changing this power to 0.5, that's too low, yeah, that looks pretty good , so you can see how to establish balance and find the good.
The balance for wavefunction

collapse

is a little difficult, but I guess for me it's the first time using this node and this algorithm, so I think I'll be testing this a lot more for other uses. Well, that looks good now. finally let me also have some additional value to this and in this tutorial I'm going to add some yellow light and the last one, then I'm going to finish this, so first of all I'm going to create another random value based on note and some seed maybe seed for this one as well and then loop between the white color and the yellow color, which is one one zero with l and that's more like a building now well that's it what time is one in the morning so I have done?
Like four hours, sorry for being so long, this is the last

algorithmic

concert of this year. I'll plan to continue next year as well at least until I'm 50. This is number 42. I haven't thought about whether I'll do it for the next week since. Next week is the New Year's holiday, but let's see. Thanks for seeing if anyone is here, everyone is still here and I'm going to save this as a file so you can go back to the same URL and check what I've done and I'm also going to upload the hip file or this one that I just created and paste the URL of that file in the video description page so you can download it but to use this file you must have a

houdini

18.5 because I am using the new structure school dictionary and also . since side effects labs are updating to the latest version to use the wave function collapse node, okay that's something you need to be careful with so thanks for looking and if you also find this interesting video, that is, useful for other videos.
I started the patreon too, so it would be great if you could support me on that too. If you want, you can also go to that patreon page from the video description page. Well, good

night

everyone and I hope you did. I mean, happy new year everyone and I hope you have a great year next year. Well, good night and we'll see.

If you have any copyright issue, please Contact