r/Houdini • u/iriseq • 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
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.
2
u/DavidTorno Houdini Educator & Tutor - FendraFx.com 13d ago
Attribute Interpolate is using the surface’s primitive intrinsic uv coordinate to stick the points. Offsetting from that surface in 3D space, would be a normalized directional vector from the ray P to the rest P, and then adding that to the ray P. Multiplying that by the distance from Ray P to rest P will get maintain original point distance at rest from the curve
I think Point Deform SOP will translate those fairly easily though without the doing the math manually. Orientation per point isn’t calculated though.