vinyvince Posted May 7, 2021 Share Posted May 7, 2021 Dealing with thousand pieces , some with extreme aspect ration and a quick weird shape as start... Just wondering, what will be the best way to distribute the noise and UV to compensate this? something like orient the bounding box as best as possible, measure the max and min of bounding box, get the ratio from the two, use this as a attribute... ? cheers ________________________________________________________________ Vincent Thomas (VFX and Art since 1998) Senior Env and Lighting artist & Houdini generalist & Creative Concepts http://fr.linkedin.com/in/vincentthomas Quote Link to comment Share on other sites More sharing options...
Librarian Posted May 7, 2021 Share Posted May 7, 2021 int dim = chi("dim"); int npt = chi("npt"); vector pos ; vector prev_pos; int prev_prim; vector dir; vector uv; vector prim_pos; float dist; float min_dist = 0.5; float max_dist = length({0.5,0.5,0}); int pt; int prim; for(int j;j<dim*dim;j++){ prim_pos = set(j%dim,j/dim); prim = addprim(0,"polyline"); for (int i;i<npt;i++){ pos=lspline(i/float(npt-1),{0,0,0},{0,1,0},{1,1,0},{1,0,0},{0,0,0}); dist = length(pos-{0.5,0.5,0}); dist= smooth(min_dist,max_dist,dist,ch("rolloff")); dist =fit01(dist,0.5,0); dir = normalize ({0.5,0.5,0}-pos); pos += dist *dir; pos += prim_pos; uv = pos/(dim-1); pos = uvsample(1,"P","uv",uv); dist = distance(pos,prev_pos); if(dist>1 && prev_prim == prim){ prim = addprim(0,"polyline"); } else { pt = addpoint(0,pos); addvertex(0,prim,pt); prev_pos = pos; prev_prim = prim; } } } attribtransferbyuv 1 Quote Link to comment Share on other sites More sharing options...
vinyvince Posted May 8, 2021 Author Share Posted May 8, 2021 Thanks Tesan i will give a try. If UV is only the concern, not to make uniform other details method of your own, lab texture texel density is handy 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.