fxjh Posted September 3, 2022 Share Posted September 3, 2022 (edited) I want to change the line to mesh Is there a way to use VEX? help.zip Edited September 3, 2022 by fxjh Quote Link to comment Share on other sites More sharing options...
Librarian Posted September 3, 2022 Share Posted September 3, 2022 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.