Deforming points with VEX

calendar_today

07.04.2023

label

Modeling, VEX

mouse

Houdini 19.5

1 Introduction

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

2 Displace to sphere

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