vex 從放棄到入門
阿新 • • 發佈:2017-10-27
style detail one elf nts primitive spl color cnblogs
1.point 模式
int snpt = npoints(1); int spt_num = fit(ch("cur_pos"),0,1,0,snpt-1); vector cur_pos = point(1,"P",spt_num); @P += cur_pos;View Code
2.detail 模式
int npt_l = npoints(0); int npt_r = npoints(1); int npt_r1 = fit(ch("cur_pos"),0,1,0,npt_r-1); vector cur_pos = point(1,"P",npt_r1); for(intView Codei =0; i<npt_l;i++) { vector sphere_pos = point(0,"P",i); sphere_pos += cur_pos; setpointattrib(geoself(),"P",i,sphere_pos); }
3.detail 模式 四邊形 插入點
int nprm_t = nprimitives(1); int add_points = ch("add_points"); for(int i = 0;i<nprm_t;i++) { int spt_num1 = primpoint(1View Code,i,0); int spt_num2 = primpoint(1,i,1); int spt_num3 = primpoint(1,i,3); vector tmp1 = point(1,"P",spt_num1); vector tmp2 = point(1,"P",spt_num2); vector tmp3 = point(1,"P",spt_num3); vector tmpU = tmp2 - tmp1; vector tmpV = tmp3 - tmp1; vector tmp = set(0,0,0);for(int j = 0; j< add_points ;j++) { float r1 = rand(j+1); float r2 = rand(j*10+3); tmp = tmpU*r1 + tmpV*r2; tmp += tmp1; int rtn = addpoint(geoself(),tmp); } }
4.detail 模式 三角面 插入點
...
vex 從放棄到入門