deadpixel Posted June 17, 2017 Share Posted June 17, 2017 Hi Houdini hive-mind new here (sort of) looking for some advice on how I might be able to create a grid where the cells are arranged in an opus pattern. I have a cell of a minimum dimension (lets say 200x200), I want to be able to have the other cells multiple dimension of that in x and y. (400x800, 600x400 or even 200x2000 for example). Crucially there are no L shaped/tetris type arrangments. Im fairly sure it involves making a grid of cells with the minimum size, and making random selections to delete and build bigger patches, but not sure the best way to go about it without creating odd shapes. I've reached my intelligence limit, and I defer to clever folk here for any kind suggestions (or of course, solutions posted elsewhere) Thanks 2 Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted June 19, 2017 Share Posted June 19, 2017 I'm very curious, about this too. I'm moving today so I don't have access to phone. One I know bad idea would be to copy boxes to the point with random scale, the biggest one select first and remove from the group, and you can perform a check for over lap. And then correspondingly add smaller boxes.... A better idea is to use the same vine growth method with food, but in vex... A third idea would be to use a noise function and clamp to 5-6 tiers. I think there is a function in vex(math in general) that does this. No guarantee there would be not be an L, but you may be able to pick an appropriate noise function for the variety like a small perlin. Good luck. Hope u solve it. 1 Quote Link to comment Share on other sites More sharing options...
nbyte Posted June 20, 2017 Share Posted June 20, 2017 Hi, I don't know how to make it mathematically. Here you can find different Opus Pattern: https://www.mandarinstone.com/advice-and-support/stone-layouts/ As you can see most pattern are based on a 7x7 grid layout. There are mostly 4 different tile types with a aspect ratio relationship. (A=3x2 units, B=2x2 units, C=2x1 units, D=1x1 units). So you can use the points of 7x7 grid and assign scaling attributes to the points according to the type of opus pattern and copy a 1x1 tile to the points with the scaling attributes. Hope that helps... OpusPatternTool.hiplc 1 Quote Link to comment Share on other sites More sharing options...
Noobini Posted June 21, 2017 Share Posted June 21, 2017 here's my attempt....it has a bit more randomizations...but also more 'blocky' cuz my approach is to repeat a 3x3 block...a variety of them...(plus another excuse to practice For Loop...) vu_opus_grid_1.00.zip 2 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted June 21, 2017 Share Posted June 21, 2017 (edited) It's just a start, but you could turn colorful points into quads and let them randomly overwrite each other. opus_pattern2.hipnc Edited June 21, 2017 by konstantin magnus Highlighted the nodes that randomize the pattern. 3 Quote Link to comment Share on other sites More sharing options...
acey195 Posted June 22, 2017 Share Posted June 22, 2017 I guess you could check for every patch if the area is equal to the width*height, if not its an "L" shape and should be split. Fixing the corner shapes is probably the biggest challenge of this pattern, while also maintaining the larger block shapes. 1 Quote Link to comment Share on other sites More sharing options...
Noobini Posted June 22, 2017 Share Posted June 22, 2017 (edited) 1 hour ago, acey195 said: I guess you could check for every patch if the area is equal to the width*height, if not its an "L" shape and should be split. Fixing the corner shapes is probably the biggest challenge of this pattern, while also maintaining the larger block shapes. this is the logic I'm trying to work with (get 'box' of section, measure area of box vs section, if not equal then it is an irregular shape, then also must be equal or less than 6 times a 'unit' area) but..struggling with recursive coding...(clustering into 2 smaller pieces) Edited June 22, 2017 by Noobini 1 Quote Link to comment Share on other sites More sharing options...
deadpixel Posted June 22, 2017 Author Share Posted June 22, 2017 (edited) wow, thanks so much to everyone for all these great ideas, I have been playing with them all and I really appreciate it. I have tried a few things now. I had started by using using a voronoi cluster and fracture similar to the method as outlined on @mestela's cgwiki , but I could never quite get the level of control vs randomness I wanted. I also struggled to get rid of the L/Tetris shape, although I did try a similar approach as outlined by some of you. However I recently stumbled upon a thread with a brilliant solution from @trandzik which absolutely nails what I am trying to achieve and I can adapt it very well to my particular needs. Thank you so much Peter. A super-cute and most unexpected side-effect of playing about with his setup today, (and throwing in some symmetry and random deletion) - I inadvertently ended up with a pretty excellent space invader generator! See attached Edited June 22, 2017 by deadpixel smaller gif size 3 Quote Link to comment Share on other sites More sharing options...
loudsubs Posted June 22, 2017 Share Posted June 22, 2017 (edited) Playing with Konstantin's setup with an extrude sop and a for loop Edited June 23, 2017 by loudsubs 2 Quote Link to comment Share on other sites More sharing options...
trandzik Posted August 22, 2017 Share Posted August 22, 2017 On 6/22/2017 at 10:33 PM, deadpixel said: wow, thanks so much to everyone for all these great ideas, I have been playing with them all and I really appreciate it. I have tried a few things now. I had started by using using a voronoi cluster and fracture similar to the method as outlined on @mestela's cgwiki , but I could never quite get the level of control vs randomness I wanted. I also struggled to get rid of the L/Tetris shape, although I did try a similar approach as outlined by some of you. However I recently stumbled upon a thread with a brilliant solution from @trandzik which absolutely nails what I am trying to achieve and I can adapt it very well to my particular needs. Thank you so much Peter. A super-cute and most unexpected side-effect of playing about with his setup today, (and throwing in some symmetry and random deletion) - I inadvertently ended up with a pretty excellent space invader generator! See attached You are welcome! I am really happy to see it helped someone By the way that gif is just great Peter 1 Quote Link to comment Share on other sites More sharing options...
Gorrod Posted August 27, 2017 Share Posted August 27, 2017 (edited) Even though @trandzik already has an amazing solution for creating these patterns, I wanted to take a shot at it myself and ended up with the following. I didn't clean up any of the code, so this is just a mess but it works . divide_grid_2.hipnc Edited August 28, 2017 by Gorrod changed the code to make a bit more sense ;) 7 Quote Link to comment Share on other sites More sharing options...
Gorrod Posted August 30, 2017 Share Posted August 30, 2017 Because I was curious i expanded the idea of @konstantin magnus a bit and ended up with this setup. divide_grid3.hipnc 3 Quote Link to comment Share on other sites More sharing options...
acey195 Posted August 31, 2017 Share Posted August 31, 2017 nice one! no L-shapes. As an improvement, maybe you could add some constraints to the width/height ratio of the polygons. In a way that would make the generation shapes that are a bit long+thin. Quote Link to comment Share on other sites More sharing options...
Gorrod Posted August 31, 2017 Share Posted August 31, 2017 with this setup there will kind of always be some small ones left to fill up space that's left because of random length. I did improve it a little bit though so you can have some control over length / height. divide_grid3.hipnc 1 Quote Link to comment Share on other sites More sharing options...
deadpixel Posted October 29, 2017 Author Share Posted October 29, 2017 Hey @Gorrod, had a play with your latest today, thats really great! ..one thing I was curious: min/max Height range seems to do exactly as expected (if you set between '1 to 1', or '1 to 3' there will be a variety of primitives at this scale in height) however minLength doesn't seem to do the same...setting '1 to 1' there will still be some larger in length. I have absolutely no vex experience, but I messed about and adjusted the line: if(primNumbers[j] == primNumbers[j-yAmount] || primNumbers[j] == primNumbers[j+yAmount] || len(thisPrims)-1 > maxLength) break; to if(primNumbers[j] == primNumbers[j-yAmount] || primNumbers[j] == primNumbers[j+yAmount] || len(thisPrims)+1 > maxLength) break; and it seems to do the right thing? any thoughts? J Quote Link to comment Share on other sites More sharing options...
deadpixel Posted October 29, 2017 Author Share Posted October 29, 2017 ...also I would be interested if there was any way in your setup to blast the primitives that dont meet the set min/max requirements (rather than keep any small ones to fill up space of the grid)? Quote Link to comment Share on other sites More sharing options...
Gorrod Posted October 30, 2017 Share Posted October 30, 2017 As far as just deleting the primitives that are too small you could just measure their length/height in the foreach loop (see attached) For the rest there's definitly a way better (and cleaner) way to do this but I'm too lazy to rewrite the nodes right now . divide_grid3.hipnc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.