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

470

label

VEX

Attribute to Match across Inputs

favorite

174

label

VEX

Curves from Ramp Parameters

favorite

416

label

VEX

Sphere Packing / Dart Throwing Algorithm

favorite

430

label

VEX

Deintersecting spheres with Voronoi

favorite

476

label

VEX

How to Analyze VEX Code

favorite

321

label

VEX

Monte Carlo Geometry Processing