Jump to content
hi_dini

Question with 'vertexindex' functioin

Recommended Posts

Hi :D

I'm just stuyding Houdini and have some problems with VEX function named 'vertexindex'.

as I understood, It makes 'a linear vertex' from primitive and its vertex.

and so arguments need @prinnum and vertex number.

 

1.PNG.595dcc8682c94c788e1d7b59b3cdc780.PNG

 

But Look at this screenshot.

Pink number on shot is primitive number and the number behind of it is return of vertex number 0.

I wrote the VEX code as 'i@hi = vertexindex(0, @primnum, 0);'

I put 0 in third argument and I expected the result as 1 in primitive 1. because It's No.0 vertex is 1. isn't it ?

but the result was 4.

I'm so confused with it T_T

Help me wizards !!

Share this post


Link to post
Share on other sites
8 hours ago, hi_dini said:

I put 0 in third argument and I expected the result as 1 in primitive 1. because It's No.0 vertex is 1. isn't it ?

it is not, 1 that you are seeing and expecting is a point number

you can't display linear vertex numbers in the viewport natively, you can just create vertex attribute like i@lvn = @vtxnum; and visualize that to see them

essentially they are continuous numbers where first vertex of each primitive is No. of vertices of all previous primitives, second is that +1 etc. so linearly increasing numbers as if you were counting all vertices in the whole geo prim by prim in order

 

if you want to get 1 as you are expecting use primpoint(0, @primnum, 0)  or primpoints(0, @ptimnum)[0]

  • Like 1

Share this post


Link to post
Share on other sites
On 2019. 1. 11. at 11:50 PM, anim said:

it is not, 1 that you are seeing and expecting is a point number

you can't display linear vertex numbers in the viewport natively, you can just create vertex attribute like i@lvn = @vtxnum; and visualize that to see them

essentially they are continuous numbers where first vertex of each primitive is No. of vertices of all previous primitives, second is that +1 etc. so linearly increasing numbers as if you were counting all vertices in the whole geo prim by prim in order

 

if you want to get 1 as you are expecting use primpoint(0, @primnum, 0)  or primpoints(0, @ptimnum)[0]

Thanks for reply :D I understand !! Thank you !!

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

×