jonidunno Posted November 3, 2023 Share Posted November 3, 2023 Hey All! I'm trying to replicate a piece of geo as if it were pressed up against a pane of glass. I was trying to solve this without any simulations can someone point me in the right direction? Here is what I started with a sample scene. here is an image of what I wanna achieve. I think I need to do it with an attribute because eventually, I need to apply this to an alembic animation of a character so I cannot depend on position. Thanks in advance! jl_smoosh_v001.hiplc Quote Link to comment Share on other sites More sharing options...
Librarian Posted November 3, 2023 Share Posted November 3, 2023 (edited) @jonidunno check also Five Elements Elf Otls for Vex solution. Here is Vop. dv1.hiplc dv2.hiplc Edited November 3, 2023 by Librarian 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 3, 2023 Share Posted November 3, 2023 Hi @jonidunno, you can project a mesh onto a plane using the planepointdistance-function with a grid on the second input: // PARAMETERS float in = chf('in'); float out = chf('out'); float off = chf('offset'); float soft = chf('soften'); // PLANE vector p; vector pos_pt = point(1, 'P', 0); vector nml = prim_normal(1, 0, vector(0.0)); float d = planepointdistance(pos_pt, nml, v@P, p); vector plane = p + normalize(nml) * off; // MASK vector dir = normalize(pos_pt - v@P); float angle = dot(dir, nml); float sdist = sign(angle) * d; float bias = smooth(-out, in, sdist); float mask = smooth(-soft, soft, sdist); vector pos = lerp(v@P, plane, bias); // OUTPUT f@mask = mask; v@P = pos; Later I might discuss the code a bit here: https://procegen.konstantinmagnus.de/pressing-meshes-against-a-plane pressing_plane.hipnc 2 Quote Link to comment Share on other sites More sharing options...
hannes603 Posted November 3, 2023 Share Posted November 3, 2023 There is a node in houdini, which is called: ray . maybe check some tuts on youtube its really super simple! Geo_against_Glass_press_ray_node.hip 2 Quote Link to comment Share on other sites More sharing options...
jonidunno Posted November 6, 2023 Author Share Posted November 6, 2023 These are all such great solutions thanks so much for the files and the knowledge! 1 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.