fiverob Posted November 28, 2016 Share Posted November 28, 2016 Hey all, Can anyone help me modify this VEX so it also includes checking if the point color of the two points are a match, and if it is a match it doesn't make the line? Thanks legends! Quote void line(int pt1; int pt2) { int prim = addprim(0, "polyline"); addvertex(0, prim, pt1); addvertex(0, prim, pt2); } int i, pt; int handle = pcopen(0, "P", @P, chf("radius"), chf("maxpoints")); for (i=1;i<pcnumfound(handle);i++) { pt = pcimportbyidxi(handle, "point.number", i ); if (pt>@ptnum) { line(@ptnum, pt); } } pcclose(handle); Quote Link to comment Share on other sites More sharing options...
f1480187 Posted November 28, 2016 Share Posted November 28, 2016 vector pt_cd = point(0, "Cd", pt); if (pt > @ptnum && pt_cd != @Cd) Easy. Quote Link to comment Share on other sites More sharing options...
fiverob Posted November 28, 2016 Author Share Posted November 28, 2016 12 minutes ago, f1480187 said: vector pt_cd = point(0, "Cd", pt); if (pt > @ptnum && pt_cd != @Cd) Easy. Thanks! I really have to start sticking it out a while longer before posting. I worked out how to do it a different way while waiting. Thanks for the alternative though! void line(int pt1; int pt2) { int prim = addprim(0, "polyline"); addvertex(0, prim, pt1); addvertex(0, prim, pt2); } int i, pt; vector ptclr; int handle = pcopen(0, "P", @P, chf("radius"), chf("maxpoints")); for (i=1;i<pcnumfound(handle);i++) { pt = pcimportbyidxi(handle, "point.number", i ); pcimport(handle, "Cd", ptclr); if (ptclr != @Cd) { if (pt>@ptnum) { line(@ptnum, pt); } } } pcclose(handle); 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.