Jump to content

vex group intersect


Recommended Posts

In attached hip, I'm trying to understand a second VEX code I've taken from Paul Esteves video vex groupname, I have no idea what's really going on, I thought I would get a result but the group is different than what I expected so I misunderstood the code. Could you please comment code lines, this may help shed some light (trying to learn vex)

 

vex_group_intersection.png

fron reference video.png

vex_group_intersection.hiplc

Link to comment
Share on other sites

That piece of code is assigning a 1 or a 0 to a group called "selected" The result of check>=0 will return a zero or a one. If you read the documentation on the intersect function you'll see this...

Quote

Returns

The intersected primitive number, or -1 if there was an error or the ray didn’t intersect anything.

Basically, if you get a -1, it won't be added to the group.

Link to comment
Share on other sites

@karen I recommend you to ask these types of questions to ChatGPT. Just give it the code snippets and ask questions like, "Can you break it down for me? ", "I can't understand x part of this code snippet. Can you make it more clear for me?". It works perfectly fine most of the time. If you don't know about specific VEX function you can use Dashbox ( use CTRL+D to open it), it's a global search function of Houdini UI and just type in the name of the function you're looking for and voila! It'll take you to the documentation of that specific function. It's not limited to functions though you can search for whatever you want. You can use certain keywords to filter context, for example, #vex intersect. This will eliminate results from other contexts that also include intersect in one way or another. If you still cannot get your head around certain things after reading documentations it's completely fine. Ask ChatGPT to give you some examples on whatever you're struggling with. Don't get me wrong, asking questions on forums is okay but it may take too long to get answers sometimes, even for relatively easy things. I hope that helps. Cheers!

Edited by Omega-Minus
correction for misspellings
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...