RTHMan Posted November 12, 2021 Share Posted November 12, 2021 I'm wondering if I can add a texture like this to individual faces of a grid? Quote Link to comment Share on other sites More sharing options...
Librarian Posted November 12, 2021 Share Posted November 12, 2021 void grid ( int resx,resy){ for(int i;i <resx*resy;i++){ vector pos = set(i%resx,i/resy)/set(resx-1,resy-1); addpoint(0,pos); if (pos.x < 1 && pos.y<1){ addprim(0,"poly",i,i+resx,i+resx+1,i+1); } } } grid(4,4); void sample_axb(int prim,a,b){ for(int i;i< a*b;i++){ vector uvw = set( i%a,i/a)/set(a-1,b-1); vector uvw_p = primuv(0,"P",prim,uvw); int pt = addpoint(0,uvw_p); vector color = colormap("Mandril.pic",uvw); setpointattrib(0,"Cd",pt,color); } } sample_axb(@primnum,150,150); vector center_uvw = {0.5,0.5,0}; vector vt0_uvw = {0,0,0}; vector vt1_uvw = {0,1,0}; vector vt2_uvw = {1,1,0}; vector vt3_uvw = {1,0,0}; vector vt0_p = primuv(0,"P",@primnum,vt0_uvw); vector vt1_p = primuv(0,"P",@primnum,vt1_uvw); vector vt2_p = primuv(0,"P",@primnum,vt2_uvw); vector vt3_p = primuv(0,"P",@primnum,vt3_uvw); vector center = primuv(0,"P",@primnum,center_uvw); int cpt = addpoint(0,center); vector uvw_dir = vt3_uvw -center_uvw; vector p_dir = vt3_p -center; setpointattrib(0,"N",cpt,p_dir); Quote Link to comment Share on other sites More sharing options...
RTHMan Posted November 12, 2021 Author Share Posted November 12, 2021 Can I apply that to a modeled mesh like the pig also? lux-richhill-191116-pig-fur0.jpg (1612×912) (artstation.com) Quote Link to comment Share on other sites More sharing options...
Librarian Posted November 12, 2021 Share Posted November 12, 2021 The last one wrang 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.