Jump to content

line to 2d mesh vex?


fxjh

Recommended Posts

vector pos(float u,t){
        vector p = set(0,u,0);
        p+= u *0.2*curlnoise(p+0.1*t);
        return p;
        
    }
    
int npt = 30;
for (int i;i<npt;i++){

    float u = i/float(npt-1);
    vector p= pos(u,@Time);
    vector next_p = pos(u+0.1,@Time);
    vector up = normalize(next_p-p);
    vector4 ori = dihedral({0,1,0},up);
    int pt = addpoint(0,p);
    setpointattrib(0,"orient",pt,ori);
    matrix3 r =qconvert(ori);
    vector v = set(r.xx,r.xy,r.xz);
    vector side = set(r.zx,r.zy,r.zz);
    setpointattrib(0,"v",pt,v);
    setpointattrib(0,"side",pt,side);
    }
int pts0[];
int pts1[];

for(int i;i<i@numpt;i++){


        vector p = point(0,"P",i);
        vector dir = point(0,"side",i);
        dir = normalize(dir);
        float u = float(i)/(@numpt-1);
        u = chramp("ramp",u);
        vector p0= p+dir*u;
        vector p1= p-dir *u;
        int pt0 = addpoint(0,p0);
        int pt1= addpoint(0,p1);
        append(pts0,pt0);
        append(pts1,pt1);
        
        }
        
 for (int i;i<@numpt-1;i++){
 
 
        addprim(0,"poly",i,i+1,pts0[i+1],pts0[i]);
        addprim(0,"poly",pts1[i],pts1[i+1],i+1,i);
        }

use Sweep Node Best

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...