Deforming points with VEX

calendar_today

07.04.2023

label

VEX, Hard-surface

mouse

Houdini 19.5

Description

On-going list of point deformations using point wrangles. To be continued.

1 Displace to sphere

C
        vector pos_sphere = chv('position_sphere');
float r = chf('radius_sphere');

vector pos_hit = v@P;
vector pos_ray = pos_hit;
vector dir_ray = {0,0,-1};

float t = dot(pos_sphere - pos_ray, dir_ray);
vector p = pos_ray + dir_ray * t;
float y = length(pos_sphere - p);

if(y < r){
    float x = sqrt(r*r - y*y);
    pos_hit = pos_ray + dir_ray * (t - x);
}

v@P.z = lerp(v@P.z, pos_hit.z, f@mask);
    
download

Downloads

link

Related articles

favorite

396

label

VEX

Attribute to match across inputs

favorite

279

label

VEX

Sphere Packing / Dart Throwing Algorithm

favorite

301

label

VEX

Deintersecting spheres with Voronoi

favorite

336

label

VEX

Fitting Planes to Point Clouds

favorite

338

label

VEX

How to Analyze VEX Code

favorite

178

label

VEX

Monte Carlo Geometry Processing