Vex Connect two points with a line

   3538   2   0
User Avatar
Member
70 posts
Joined: Aug. 2021
Offline
Hello
I have a problem, I don't understand why I can't connect two points to create a line with vex (ofc it works if i use "add" sop, but i want to use vex) ?

This is my vex :

int points[];
vector max = detail(1,"max");
vector zpos = set(0,0,max.z);
addpoint(0,0);
addpoint(0,zpos);
addprim(geoself(), "polyline", points);
User Avatar
Member
5278 posts
Joined: Feb. 2012
Offline
Hi,

Your points array is empty. You have to populate it with the new point numbers or just pass them directly to addprim:

int points[];
vector max = detail(1,"max");
vector zpos = set(0,0,max.z);
int pt0 = addpoint(0,0);
int pt1 = addpoint(0,zpos);
addprim(geoself(), "polyline", pt0, pt1);
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
70 posts
Joined: Aug. 2021
Offline
Thank you very much
  • Quick Links