码迷,mamicode.com
首页 > 其他好文 > 详细

a bit of VEX

时间:2020-04-12 07:58:44      阅读:67      评论:0      收藏:0      [点我收藏+]

标签:direction   dir   step   offset   point   code   tor   uri   res   

//Create a line with points
int
pt_max = chi("Point_Max"); float length = chf("Length"); vector dir = chv("Direction"); dir = normalize(dir); vector offset = chv("Offset"); float stepVal = length / (float)(pt_max-1); int pts_all[]; resize(pts_all, pt_max); for(int i = 0; i < pt_max; i++) { vector pos = dir * (stepVal * i) + offset; int curId = addpoint(0, pos); pts_all[i] = curId; } //addprim(0, "polyline",pts_all); for(int i = 0; i < pt_max-1; i++) { addprim(0, "polyline", pts_all[i], pts_all[i+1]); }
//make it circle!
float
gradiant = (float)@ptnum/(float)(@numpt - 1); @P.y = sin(gradiant * 2 * $PI); @P.z = cos(gradiant * 2 * $PI);

 

a bit of VEX

标签:direction   dir   step   offset   point   code   tor   uri   res   

原文地址:https://www.cnblogs.com/TadGuo/p/12683311.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!