Jump to content

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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?

 

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×