asxp3 Posted March 27, 2017 Share Posted March 27, 2017 I found two tutorials which talk about this topics, one is the LRV from Digital tutor, another is the attribute transfer from peter, but sadness, neither one work on current houdini. So anyone can give me an idea or example file for doing this ? Thanks so much. Quote Link to comment Share on other sites More sharing options...
3dome Posted March 28, 2017 Share Posted March 28, 2017 dm_terrainDeform.hip Quote Link to comment Share on other sites More sharing options...
asxp3 Posted March 28, 2017 Author Share Posted March 28, 2017 Thanks Dominik, This is very helpful, could you please give me a brief idea that how does this work? I really cannot understand the idea behind of this base on my current knowledge. Thanks a lot. Quote Link to comment Share on other sites More sharing options...
3dome Posted March 28, 2017 Share Posted March 28, 2017 so how this works is basically it takes each point on the grid and looks up how "deep" inside the volume of the wheel it is. then it pushes it along the normal by that value so that it is not inside anymore. lets say u got a sphere (radius 1.0) and converted it to VDB then the maximum how deep a point can be is 1 (when its in the center of the sphere). This 1 is actually a -1. The surface of the VDB represents the value 0 and goes from there into the sphere becoming negative and out of the sphere you get positive values. check the new file where I provided two methods. the same as before (with clean code) and a pure SDF based version. concept is the same except instead of normals it uses the gradient of the volume as pushing direction. the result is slightly different but i think the SDF one is more flexible when it comes to complex geo and its normals but choose whatever does the trick for you dm_terrainDeform2.hip 1 Quote Link to comment Share on other sites More sharing options...
asxp3 Posted March 29, 2017 Author Share Posted March 29, 2017 (edited) Hum, could you please explain the meaning of the code : float vsamp = volumesample(1, 0, @P); vector vgrad = normalize(volumegradient(1, 0, @P)); if(vsamp < 0) { @P += vgrad * -vsamp; } I don't understand the algorithmic Edited March 29, 2017 by asxp3 Quote Link to comment Share on other sites More sharing options...
3dome Posted March 29, 2017 Share Posted March 29, 2017 get the value of the volume coming in from second input at the position of the current point that is processedfloat vsamp = volumesample(1, 0, @P);get the gradient of that volume (direction in which the volume values increase) at the position of the current pointvector vgrad = normalize(volumegradient(1, 0, @P));is the vsamp < 0 so is the point inside the volume thenif(vsamp < 0){ the new point position is its position + the direction * the negative vsamp to push it out @P += vgrad * -vsamp;} have a look at the docs and read about openVDB it's really not too hard just basic vector math with information from volumes 1 Quote Link to comment Share on other sites More sharing options...
asxp3 Posted March 29, 2017 Author Share Posted March 29, 2017 Thanks Dominik, This gives me a much better understanding of the code, and I will look up the docs about the openVDB topic. Thanks so much for your help. 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.