Transform points into a grid.

   1917   5   0
User Avatar
Member
17 posts
Joined: March 2017
Offline
Hello everyone,

I'm a noob to Houdini and falling in love with it. For quite a while now I've been trying to transform a collection of points into a grid. I have tried various techniques with my limited knowledge and reached the point to give up. Can someone please help please.

I have tried for-loop and wrangle nodes, but always end up with a diagonal transformation. I really would like to do something like the code below but with existing points.

for (int n=0; n<10; n++)
{
for (int i=0; i<10; i++)
{
addpoint(0, set(n, i, 0); //If I substitute this with @P += set(n, i, 0), I get diagonal layout.
}
}


I'm sure there is a better a approach. I've even tried it with a copy node, but I can't get the individual element to copy on each point, it would just copy all the points onto the given grid points. I've been speed learning Houdini for two weeks and a bit embarrassed to ask for help for something that might be a trivial thing.

I appreciate any help. Thank you.
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
Yes because your code is telling it to go diagonal.( in the x and y direction )

Maybe you could give an example of what you expect the results to be.
Edited by BabaJ - April 29, 2019 17:56:45
User Avatar
Member
648 posts
Joined: July 2005
Offline
see attached…

Attachments:
pts_to_grid.hiplc (88.8 KB)

User Avatar
Member
17 posts
Joined: March 2017
Offline
Thank you BabaJ an cpb for the response, I really appreciate it.
I realized that I don't need to arrange the Primitives in a grid fashion. Honestly I just wanted to learn how to manipulate a set of clustered primitives, but I'm too dumb to understand Houdini's VEX. I've attached my files to show what I've been doing.

My goal is to go trough every cluster of primitives and generate strips that matches the the silhouette/volume of the curves.
UV the strips and bake out a texture. Basically, I'm trying to make a polygon strips from the curves and generate game friendly hair textures.

I know my goal this is of topic. Again, I appreciate your help. I just have a lot VEX learning to do.

Attachments:
HairCurves.fbx (547.1 KB)
PrimsToGrid.hipnc (509.1 KB)

User Avatar
Member
648 posts
Joined: July 2005
Offline
see attached,
sort by cluster, then uv-layout.

Attachments:
clusters_to_uvlayout.hipnc (586.8 KB)

User Avatar
Member
58 posts
Joined: April 2008
Offline
swarmagent
Thank you BabaJ an cpb for the response, I really appreciate it.
I realized that I don't need to arrange the Primitives in a grid fashion. Honestly I just wanted to learn how to manipulate a set of clustered primitives, but I'm too dumb to understand Houdini's VEX. I've attached my files to show what I've been doing.

My goal is to go trough every cluster of primitives and generate strips that matches the the silhouette/volume of the curves.
UV the strips and bake out a texture. Basically, I'm trying to make a polygon strips from the curves and generate game friendly hair textures.

I know my goal this is of topic. Again, I appreciate your help. I just have a lot VEX learning to do.
can u attach the hair shell object?thx
  • Quick Links