# Point alonge curve, vex understanding help

## Recommended Posts

Hi,

I´m just have a deeper look at the nice folding objects example on the Houdini cgwiki: http://www.tokeru.com/cgwiki/index.php?title=Houdini#Folding_objects_.28the_transformers_cube_effect.29

The wrangle node which handles the animation makes me some headache. It´s a wrangle node running over Primitives:

This part I understand so far...

Quote

vector start = primuv(0,"P",@primnum, (0,0));
vector bb = relbbox(0, start);
float t = @Time+bb.x;
t = @Time*2 + length(start)+rand(@primnum);
t -= ch('time_offset');
//
t *= fit(rand(@primnum),0,1,.7,1.3);

here a new point position is set with the primuv function, as i understand...

Quote

vector newP = primuv(0,"P",@primnum, set(t,0));

a new point is generated at the new position and theattribute name is set , newP from above...

Quote

setpointattrib(0,'name',newpt,s@name,'set');

but what the hell means this? The prim is removed with his points? When the prims are removed there are no prims left to run the code again over the prims, because there all deleted... what do i missunderstand?

Quote

removeprim(0,@primnum,1);

Generates this code every frame new points on the prim and delete them afterwards? But why points are remain and travel over the prim, in this case a line?

Can somebody give me some light on this?

tia

##### Share on other sites

Creation/deletion of geometry happens after the code is run. So it creates new points, and deletes the primitives. Since the newly created points isnt there until after the code is run, they wont be deleted.

##### Share on other sites

thank´s, got it. My fault was also, not to see the whole nodes flow. Everytime the complete node structure is evaluate, "new" prims are feeded into the code and the prims are only needed to get the new point position.

## Create an account

Register a new account