Jump to content
Sign in to follow this  
fxjh

line to 2d mesh vex?

Recommended Posts

I want to change the line to mesh Is there a way to use VEX?

 

 

 

help.zip

 

image.thumb.png.e68e12bb5a221b98f98e9798a66a8d47.png

 

 

 

Edited by fxjh

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×