Jump to content

Can't access components of a vector with point()?


gazegaze

Recommended Posts

Hi,

Learning VEX and this is simply out of curiosity since I'm trying to build an intuition for how houdini works under the hood.

I know I can read a vector from say point 5, like so:

vector test = point(0, "P", 5);
printf("%f", test);

{0.091506,0.482963,-0.091506}

Is there a way I can directly access only a component, like P.x with the point function?

To my surprise, substituting "P" with "P.x" doesn't work, i.e:

float test = point(0, "P.x", 5);
printf("%f", test);

0.000000

 

I know I can access it via variable indices in the first example like

vector test = point(0, "P", 5);
printf("%f", test[0]);
 

0.091506

but it doesn't seem to work within the function. Neither "P.x" nor "P[0]" works. Is there a good reason for this?

Grateful for any input you may have!

GG

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