how do i create connection lines between two or more points in wrangle ?

   13230   2   0
User Avatar
Member
13 posts
Joined: May 2017
Offline
I'm making spider web shooter.

I already completed points order and particle system.

I tried to create line using “add” but there are several problems.



it doesn't connect between first point and last point.
- you can see a picture “connectionLine.png” .
there are points 6,7,8,9,10,11 and 12,13,14,15,16,17.(I seperated 2groups.)
but 6 and 11 doesn't connect. also 12 and 17.

-> so I think that i will be easier if i know how to create line in wrangle.


I was supposed to wire simulation.
I tried.
shooter points have to be constrained. so I used “Constrain” or “wire glue”.
but I made that I can handle the number of shooter points. (there is “Group” parameter but there was no group I made)

Could you have any good idea or solution?


Thank you for reading
Edited by gosinabro - July 10, 2017 22:06:32

Attachments:
1.gif (549.1 KB)
GIF.gif (554.5 KB)
connectionLine.png (1.1 MB)

User Avatar
Member
2040 posts
Joined: Sept. 2015
Offline
In a wrangle, say for just two points…

int New_Prim;

New_Prim = addprim(geoself(), "polyline");

addvertex(geoself(), New_Prim, 0); // 0 is point number 0
addvertex(geoself(), New_Prim, 1); // 1 is point number 1

Just keep adding the function addvertex with a new corresponding point number and same ‘New_Prim’ number to keep
those points belonging to same primitive.

You may want to create ‘for’ loop/s for many points using the index of the loop as the point numbers.

And create your own sorting algorithm beforehand to get the order of points you want before passing on to the ‘for’ loop for connection.

Of course you can put your ‘sorting’ algorithm within the for loop itself if you want.

And/or if you need different sets of points belonging to different primitives, create groups of points as well.


http://www.sidefx.com/docs/houdini/vex/functions/addprim [www.sidefx.com]
http://www.sidefx.com/docs/houdini/vex/functions/addvertex [www.sidefx.com]
User Avatar
Member
13 posts
Joined: May 2017
Offline
Thank you so much! BabaJ.

I made it

Have a nice day!!
  • Quick Links