Houdini Quicktip #02 - Creating Points, Vertices & Primitives using VEX

Available for freelance: hello@fifty-50.uk

Learn how to do the following using VEX:

- Create Points
- Create Vertices
- Create Primitive(Polylines)
- Create Primitive(Full polygon)
- Problems with point order
- Normal direction based on the point order

Code:

int pnt0 = addpoint(0,{0,0,0});
int pnt1 = addpoint(0,{0,1,0});
int pnt2 = addpoint(0,{0,1,1});
int pnt3 = addpoint(0,{0,0,1});

int prim0 = addprim(0,'poly');

int vert0 = addvertex(0,prim0,pnt0);
int vert1 = addvertex(0,prim0,pnt1);
int vert2 = addvertex(0,prim0,pnt2);
int vert3 = addvertex(0,prim0,pnt3);