filipw Posted November 18, 2018 Share Posted November 18, 2018 Hi, I'm new here (and new to houdini as well) and have a very similar problem to what I have aleady seen here considering scattering and tiling. I have not been able to solve it yet so I take the chance of asking: I want to distribute/tile objects over an area without changing scale and orientations. Lets say the object are rectangular tiles of slight variations. Like taken from at stack for real planks or marble tiles. Basically laying down a floor like a craftsman would do it. Using the UV-layout SOP solves it on a technical level but it is not possible for me to art direct it or randomize the placements of planks in a satisfying manner. So what other approaches are there? If I would write this in pseudo-code it would be something like: // variables given at start Rect areaBounds; Rect tileBounds[10]; // a list of placed tiles Rect placedTiles[MAX_TILES]; // availble space Rect availableSurface = areaBounds; while (AreaOf(availableSurface)>0) { Rect tileToTest = tileBounds[randomChoice(10)]; if (DoesTileFit(areaBounds, tileToTest) { AppendTile(placedTiles, tileToTest); ReduceAvailableArea(availableSurface, tileToTest); } } But I just assume this is one of more common operations that people do and there is an easy to use solution in Houdini that I just don't know about... Quote Link to comment Share on other sites More sharing options...
filipw Posted November 18, 2018 Author Share Posted November 18, 2018 I got something basic "working" but it feels wrong since I have to write a lot of code and use very few nodes. Ideas on how to make this the "correct houdini way" are very welcome! I wrote most as a detail VEX wrangle that uses more or less the example code above to create some targets points/origins for assets to be copied to. I also set an attribute so that the copy SOP can make choice later. For the test it copies some very basic "fake tiles" to the destinations. vex_tile_floor.hipnc Quote Link to comment Share on other sites More sharing options...
filipw Posted November 19, 2018 Author Share Posted November 19, 2018 Anyway, here is my final solution for my need but I would be very happy if anyone could suggest improvments. As it is now it is an unholy mixture of nodes and VEX and expressions.... vex_tile_floor_v2.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.