Jump to content

vex arrays


sanostol

Recommended Posts

Hi,

I tried some stuff with vex and vex arrays and disscovered that things like this. For a vertical line with 5 points i get this:

float positions[];
positions=P.x;
printf ("%f", (positions));

Logged Message:

{0, 0, 0}{0, 1.25, 0}{0, 2.5, 0}{0, 3.75, 0}{0, 5, 0}

float positions[];
positions=P.y;
printf ("%f", (positions));

Logged Message:

{0}{1.25}{2.5}{3.75}{5}

but when I use:

float positions[];
positions=P;
printf ("%f", (positions[1]));

Logged Message:

0.0000001.2500002.5000003.7500005.000000

I would expect the vector compontents of the second vector to be logged, but instead i get the complete list of all vector's y-components. strange. is there a way to reference the vectors by index?

Another question, is there a way to import other attributes from all points into a array?

thanks

Martin

Edited by sanostol
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...