Jump to content

Question with 'vertexindex' functioin


hi_dini

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 !!

Link to comment
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
Link to comment
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 !!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...