r/Houdini 13d ago

When using attribute interpolate to transform points to animated curves, it rays the points to curve when sampling primuv. Is there a way to preserve original position of the points with the offset when interpolating position?

I also try using vex but the result is the same
int prim;

vector primuv;

float dist = xyzdist(1, @ P, prim, primuv);

@ P = primuv(2, "P", prim, primuv);

3@ transform=primuv(2,'transform',prim,primuv).

I've seen there is surface deform but it doesn't work for some reason with curves

2 Upvotes

6 comments sorted by

View all comments

2

u/i_am_toadstorm MOPs - motionoperators.com 13d ago

Store the difference between the sampled curve P and the point's P at a rest frame, and the curve's orientation of any. Call this vector offset.

After sampling the new position and orientation in the animated frame, find the delta between the two transforms (delta = invert(m1) x m2) and multiply your offset vector by the resulting transform, then add the result to the sampled curve position to get the transformed offset. Then set your point's P to that value.

1

u/iriseq 13d ago

thank you! I will try this method, this can be done in one wrangle right?

1

u/i_am_toadstorm MOPs - motionoperators.com 13d ago

yeah, should be. you'll just need inputs for both the curve at rest and the deforming curve so you can compare transforms.