watchman Posted February 7, 2009 Share Posted February 7, 2009 hi to everybody, does anyone have an idea how to randomly comb/rotate/slant normals down to the surface level without overlapping/intersecting them with each other? any link or useful search tag that can lead to procedural solution would be appreciated. perhaps video can better explain my problem: normals_fall_down.mov normals_fall_down.hipnc (idea on how to avoid overlapping these little tubes?) thanks, nem Quote Link to comment Share on other sites More sharing options...
eetu Posted February 8, 2009 Share Posted February 8, 2009 An interesting problem, congrats! I suppose a simulation is out of the question. Here's a thinking-out-loud sort of nonoptimal solution within sop-land. We start with scattered points: Next we want to know about our neighbors. Let's add a triangulate-2d sop. Hmm, interesting, now we have edges to our neighbors. We don't want to lay our normal along any edge, because then another normal might well end up along the same edge. So, we might just as well decide to lay it in the middle of two edges. It sounds reasonable to orient the normal to the direction where the neighbors are farthest, so let's pick the middle of the two longest edges. This can be rephrased as the midpoint of the farthest of the edges "across" from the current point. (sorry, lacking some english geometry vocabulary here Luckily there is just the operation to get these points - the "dual" mode of the divide sop. Ok, it's not exactly those points, but halfway across. No worry, we're only interested in the direction. Now for each point we have a polygon, the points of which describe the directions to the middle of neighboring points. Next we need to find the farthest of the polygon's points, but I didn't find a simple way to do that Probably some foreach loop could find it, but that's, uhm, left as an exercise to the reader Instead, I just took the centroid of the polygon, I think generally it should be somewhere close to the direction of the farthest point.. Now all that is left is to set the normal of the original points to the direction of these centroids - just a point sop with $TX2 - $TX etc. Soo.. this is just a hand-waving method with some short cuts taken, but hopefully it gives some ideas. It's clearly not perfect, but it's hard to say if there even exists a "correct" answer for the problem. A vop sop using point clouds might be another direction to look at. I'd love to see other solutions too eetu. comb2.hip Quote Link to comment Share on other sites More sharing options...
eetu Posted February 8, 2009 Share Posted February 8, 2009 Ah, just couldn't leave this alone.. Got thinking about volumes. Here we copy metaballs to the original points, and make a volume of that. Now the volume gradient at each point equals the direction of "most/closest neighbors". In a point sop we set the normal to the inverse of the above - the direction where the pointcloud is sparsest in the neighborhood. Increasing the metaball radius or weight increases the correlation between neighboring normals. This makes the solution better, especially with a dense point cloud. On the other hand the result becomes less random, and randomness was one of the original requirements. But, depending on use, something like this might even be fitting.. eetu. comb3.hip Quote Link to comment Share on other sites More sharing options...
eetu Posted February 8, 2009 Share Posted February 8, 2009 Oh well. Looking at the previous one I thought that if the point distribution is pretty uniform, the local density isn't that all-important. Leaving sop-land, here's a version from a vop sop with just a curl noise inside. As before, if we dial down the randomness we get a better solution. comb4.hip Quote Link to comment Share on other sites More sharing options...
watchman Posted February 8, 2009 Author Share Posted February 8, 2009 (edited) -----suppose Worley is the way to go, instead of finding the closest neighbor, lets find the furthest, but closest neighbor in the same time and lean our normal that way, thanks, appreciate that! Edited February 8, 2009 by watchman Quote Link to comment Share on other sites More sharing options...
watchman Posted February 8, 2009 Author Share Posted February 8, 2009 (edited) eetu, thank you for great ideas, vangoghian pattern of solution no.3 with curl noise is aesthetically most suitable for what I need, but now I have to find replacement for $NX=0 expression in Point SOP in order to use this method on sphere instead on flat plane. suppose I can flat them down with Ray SOP, but can't make it working. Any idea? EDIT: ok, solved. copy the 2-point Line on points, so there is a new point on tip of each normal, then flatten those new point back to surface with Ray SOP, then delete every other point so there is just new points, then orient original normals to new points with $T2-$T expression. Edited February 8, 2009 by watchman Quote Link to comment Share on other sites More sharing options...
eetu Posted February 8, 2009 Share Posted February 8, 2009 No raying necessary. Just add utangent and vtangent with polyframe sop (what a welcome addition to the toolset btw!), and in the vop sop use only the noise vector's components along the tangents. eetu. comb5.hip Quote Link to comment Share on other sites More sharing options...
watchman Posted February 8, 2009 Author Share Posted February 8, 2009 that's much better solution, thank you. normals_fall_down4.mov Don't know if it's possible to see because of small resolution - but in this test render couple of these small guys keep dangling when everything stops and rotate around its normal axis quiet erratically. I know this is a strange question, but does anyone have an idea why is that happening and how to calm them down? 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.