Jump to content

Houdini makeing tire tread that distort the terrain


asxp3

Recommended Posts

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.

 

 

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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 by asxp3
Link to comment
Share on other sites

get the value of the volume coming in from second input at the position of the current point that is processed
float vsamp = volumesample(1, 0, @P);
get the gradient of that volume (direction in which the volume values increase) at the position of the current point

vector vgrad = normalize(volumegradient(1, 0, @P));
is the vsamp < 0 so is the point inside the volume then

if(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



 

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...