![]() Where r is some random value from 0-1 //Where axis is an integer 0 or 1 //Where prim is our current primitive r = clamp ( r, 1e-3, 1. ![]() Assuming we want to split on the UV’s x-axis, we would then want to define our split positions as so (make sure you read the code comments too, you dorks): In the case of a quad, each corner of the quad will correspond with corners of that arbitrary UV Map (,, , and respectively). What makes this function so amazing is that it interpolates any given attribute over the polygon, at some arbitrary UV value, including position. Since we’re all houdini experts, we probably know that built into VEX is a nifty function called primuv(). For the purposes of this article im going to break the process down into a bunch of smaller algorithms that we can combine together to reach our intended result. So let’s drop down a grid to start with and set its divisions on each axis to two. ![]() One last caveat is that this will only work for quads, aka polygons with only 4 points. Mesh is highlighted because most approaches I’ve seen really only cover flat 2d surfaces, but the approach extends into 3 dimensions as well. Our goal is quite simple, given an input mesh, add some random AXIS ALIGNED division to each face in the mesh, and then repeat. 9/10 times will there be a more efficient vex based approach to remove at least one of those For-Each Blocks. Anytime you see a double For-Each block in houdini, a red flag should go up. This is going to be a vex based approach which on the surface appears very similar to this method, but allows for far more flexibility, and is far and away more efficient. Actually that’s not true, instancing things onto the mesh in conjunction with mesh partitions, is definitily the hot ticket, but regardless, I’m just going to be focusing on mesh partitions. I figured the smartest approach would be to actually partition the mesh, as opposed to instance things onto the mesh. I’m a pretty big fan of greebling, and I’ve been generally unimpressed with most of the greebling methods I’ve seen in Houdini and other most apps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |