# Question with 'vertexindex' functioin

## Recommended Posts

Hi

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.

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 on other sites

I think you misunderstand what is a vertex.

See the documentation here : https://www.sidefx.com/docs/houdini/model/attributes.html#geometry-components

You can display the vertex number in the display option panel.

##### 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]

• 1

##### 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  I understand !! Thank you !!

## Create an account

Register a new account