Curve Points attracting or pushing each other by attribute.

   2032   6   3
User Avatar
Member
403 posts
Joined: June 2015
Offline
I'm looking for a way to have points attracting each other based on an underlying attribute. So if the attribute is -1 point are being pushed away from each other, and when the attribute is “1” the points get attracted to each others. i'm saying “underlying” because i'm thinking of a dynamic attribute from an underlying geometry that would be transferred to an other (more or less) matching geometry.

The intent is to recreate in a dynamic (animate-able) fashion the looks of those fascinating images from the retina-pack (https://www.tfmstyle.com/retina-pack) onto any kinda of 3D geometry.

Any tips and insight highly appreciated.

Cheers,

A.
Edited by Adriano - Nov. 29, 2019 12:30:56
User Avatar
Member
897 posts
Joined: July 2018
Offline
Best way to get that kind of pattern is in my experience to do a shortest path setup and drive the resulting paths by manipulating the terrain.

To get going, noise up a height field, convert to polys, do a shortest path from all points to a single one.
B.Henriksson, DICE
User Avatar
Member
403 posts
Joined: June 2015
Offline
kahuna031
Best way to get that kind of pattern is in my experience to do a shortest path setup and drive the resulting paths by manipulating the terrain.

To get going, noise up a height field, convert to polys, do a shortest path from all points to a single one.

Thanks for the tips. I'm trying to avoid terrain tools by all means, not only because i'm pretty sure that those retina textures are actually created with such, most likely some flow maps from wold creator or any kinda erosion tools and alike, so it'd be a bit redundant….but mostly i want to be able to create those patterns and shapes in a procedural seamless way on any kinda geometry and not just on flat squarish surfaces.

Thanks for your time.

Cheers,

A.
Edited by Adriano - Nov. 29, 2019 22:47:01
User Avatar
Member
897 posts
Joined: July 2018
Offline
Adriano
kahuna031
Best way to get that kind of pattern is in my experience to do a shortest path setup and drive the resulting paths by manipulating the terrain.

To get going, noise up a height field, convert to polys, do a shortest path from all points to a single one.

Thanks for the tips. I'm trying to avoid terrain tools by all means, not only because i'm pretty sure that those retina textures are actually created with such, most likely some flow maps from wold creator or any kinda erosion tools and alike, so it'd be a bit redundant….but mostly i want to be able to create those patterns and shapes in a procedural seamless way on any kinda geometry and not just on flat squarish surfaces.

Thanks for your time.

Cheers,

A.
You'll get the same result from using a poly grid, the height field is just the most convenient tool to work with a 2d grid in Houdini. The square shape is not relevant either as you can simply mask of the area from your input object. Doubt you'd need erosion tools either, it's more about modeling and rendering curves.

The question is if you want your paths in 2d or 3d, I'm pretty sure your reference is in 2d but if you want it in 3d on any input object shortest path is still the way to go. Difference now is you need to control 3d patterns to drive the path finding, then I'd recomend converting your mesh to vdb and back to mesh, this gives you a uniformly sampled toplogy to apply noise on and apply the process I described earlier.
B.Henriksson, DICE
User Avatar
Member
142 posts
Joined: Aug. 2009
Offline
If you play with this vex shader and point attributes on any object you can achieve some fun stuff. Have fun



#define PI          3.1415926535897931
#pragma label       Theta       "Maximum Theta"
#pragma label       spread      "Overall Spread"
#pragma label       DATA        "Data Points"
#pragma label       kd          "Diffuse"
#pragma label       ks          "Specular"
#pragma label       bump        "Bump"

surface
qrotation_field
(   float   Theta   = 2.0,
            spread  = 3,
            kd      = 1,
            ks      = 0.5,
            bump    = 0.1;
    string  DATA    = "$HIP/../VEX/Reading-Data-Points/_datapoints.bgeo.sc")
{
    float d, Np, theta, pFratt, factor, pspread;
    vector _P, pP, axis, pVratt;
    vector4 Q;
    string group;
    
    _P = ptransform("space:camera", "space:world", P);

    theta = snoise(_P + 0.9, 1, 0.75, 1)*4.5;
    axis = snoise(_P + 0.05, 1, 0.05, 1);
    Q = quaternion(theta, axis);
    _P = qrotate(Q, _P);
    
    for(int g = 0; g < 2; g++){
        group = concat("group", itoa(g));
        int p[] = expandpointgroup(DATA, group);
        Np = len(p);
        factor = g + 1;
        for (int i = 0; i < Np; i++){
            pP = point(DATA, "P", p[i]);
            axis = point(DATA, "N", p[i]);
            pFratt = point(DATA, "fratt", p[i]);
            pVratt = point(DATA, "vratt", p[i]);
            pspread = pFratt*spread/factor;
            d = distance2(pP, _P);
            d = exp(-d*d/pspread);
            theta = 2*PI*(pFratt*2 - 1)*d*Theta/factor;
            Q = quaternion(theta, axis);
            _P = qrotate(Q, _P - pP) + pP;
        }
    }

    vector outColor = snoise(_P*0.25, 1, 0.25, 1);

    vector Nn = normalize(computenormal(P + min(outColor)*bump, N, Ng));
    
    vector diff = diffuse(Nn)*outColor*dot(normalize(-I), N);

    vector spec = specular(Nn, normalize(-I), fit01(min(outColor), 0.5, 0.1))*0.1;
    spec += specular(N, normalize(-I), 0.05);

    Cf = diff*kd + spec*ks;
}
Edited by Librarian - Nov. 30, 2019 08:49:23
User Avatar
Member
403 posts
Joined: June 2015
Offline
Some very interesting stuff here and great resources. I haven't had time to look into it all yet, but already just wanted to thank you for taking the time to help me out.

Cheers,

A.
Edited by Adriano - Nov. 30, 2019 22:40:56
  • Quick Links