Jump to content

Recommended Posts

Hello,

Can someone please explain to me what a linear vertex is properly? I thought I understood it when I was initially trying with lines but once I applied the function on the grid, everything seems wrong.

I understood it as, primvertex points to the point number, so vertex 2 of primitive 1 should return 2 but instead it is returning 6. Not sure why?

image.thumb.png.0290d0fe5766618a9d1a08a77fd80990.png

 

 

The same function with lines give me the correct answer.

image.thumb.png.701f24ebd873d49f4b46fa4af81e1959.png

Share this post


Link to post
Share on other sites

Hi Ultraman,

Thanks for the reply. I saw this but it's still a little confusing.

Why is @vtxnum returning a single value, instead of 4 values for each vertex?

 

image.thumb.png.d2ca95ada0e57b45723346dfc7f15e0e.png

Share this post


Link to post
Share on other sites
11 hours ago, dolexd said:

Hi Ultraman,

Thanks for the reply. I saw this but it's still a little confusing.

Why is @vtxnum returning a single value, instead of 4 values for each vertex?

 

image.thumb.png.d2ca95ada0e57b45723346dfc7f15e0e.png

I'm not sure why,  Houdini vertex always is a little confusing for me - but if u want to get all vertex u can use primvertices[] . 

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Hi,

the linear vertex number is useful, if you want to loop over all vertices at once (without looping over the prims). The linear vertex is independent from the primitive, where the vertex belongs to. Each prim has multiple vertices but each vertex has only one prim. Or lets say, if you put all vertices of all primitives into one list with unique identification (increasing numbers) you will get the linear vertices.

Just put this source code into a vertex wrangle, to see the differences (you can also see, that each point can have several vertices aswell but each (linear) vertex is exactly one point reference)

i@vn = @vtxnum;
i@pv = vertexprimindex(0, @vtxnum);
i@prim = @primnum;

or just a file

 

linear_vertex.hipnc

Edited by Aizatulin
  • Like 1

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

×