Jump to content

list of vertices


Recommended Posts

Do you want to iterate over the vertices in the same node, or for some reason store them in an attribute ?

http://www.sidefx.com/docs/houdini/vex/geometry.html

http://www.sidefx.com/docs/houdini/vex/functions/vertex.html

<type> vertex(<geometry>geometry, string attribute_name, int prim_num, int vertex_num)

<type>[] vertex(<geometry>geometry, string attribute_name, int prim_num, int vertex_num)

Specifies the vertex as a primitive number and then an offset into the list of vertices on that primitive.

Link to comment
Share on other sites

I want to store them as an attribute, for each primitive of the polygon (triangle) its three vertices; 

Could the expression be something like: 

int prim_vertices[];

@prim_vertices = primvertices(0, @primnum);

The problem is I don't know how to use them correctly. Please can you tell me how I could write the full expression?

 

 

Link to comment
Share on other sites

To put the vertices in an array attribute:

i[]@prim_vertices = primvertices(0, @primnum);

You have to declare @prim _vertices as an array. You don't need the first line of your code, that would declare a variable. Unless that's what you want of course

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