Jump to content

VEX Help


fiverob

Recommended Posts

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);

 

Link to comment
Share on other sites

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);

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...