I updated this method for position noise ‘fake rig type’ deformation [here.](discord.com/channels/270023348623376395/351975587109273601/1522966273489899680)
The coherency benefits of position noise with some deform pre-process and post-process which makes it a somewhat rotation noise hybrid. It is fairly throwaway but might be useful to someone who has to iterate fast, also will run into problems when the noise frequency gets near the segment length.
Using @v for deform vector, first project onto plane of curve direction, this harmonizes the deformation for the post-process.
“`cpp // pre-process vector d = normalize(v@dir); v@v -= dot(v@v, d) * d;
// deform @P += v@v; “`
Then instead of doing the @localtransform z component trick just write positions. If you don’t need transforms it is 5 – 10 times faster.
“`cs int pts[] = primpoints(0, @primnum); int npts = len(pts); vector prevOrig = point(0, ‘P’, pts[0]); vector delta = {0}; for(int i=1; i<npts; i++){ float rest = point(0, 'seglength', pts[i]); vector origp = point(0, 'P', pts[i]); vector raw = origp – prevOrig; float curlen = length(raw); vector newp = prevOrig + delta + raw*(rest/curlen); delta = newp – origp; setpointattrib(0, 'P', pts[i], newp, 'set'); prevOrig = origp; } “`
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20261407/05/26/seglength.gif
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20261407/05/26/position_noise_coherence.hipnc