Jump to content

VEX - Accessing/printing coordinates from point ID


Mister X

Recommended Posts

Hi all :)

In an Attribute Wrangle:

int p0 = addpoint(0, set(0,0,0));
int p1 = addpoint(0, set(1,0,0));
int p2 = addpoint(0, set(1,1,0));

vector pos = point(geoself(), "P", p2);
printf("Position of p2 is: %g\n", pos);
// This prints Position of p2 is: {0,0,0} which is wrong

I would like to access the coordinates of p2 and print them out. I'm using:

vector pos = point(geoself(), "P", p2);
printf("Position of p2 is: %g\n", pos);


but instead of printing {1,1,0} it prints {0,0,0} which is wrong.
How could I print or access the coordinates correctly?

Thanks in advance

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...