elenvou Posted June 27, 2018 Share Posted June 27, 2018 Hello there!! I want to do something really easy I guess, to create a list with all the vertices for each primitive. - I am working with a polyedron- How can I do that in VEX? cheers Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted June 27, 2018 Share Posted June 27, 2018 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. Quote Link to comment Share on other sites More sharing options...
elenvou Posted June 27, 2018 Author Share Posted June 27, 2018 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? Quote Link to comment Share on other sites More sharing options...
Sean-R Posted June 27, 2018 Share Posted June 27, 2018 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 Quote Link to comment Share on other sites More sharing options...
elenvou Posted June 28, 2018 Author Share Posted June 28, 2018 thank you so much!! It works great! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.