Nicolas Longchamps

Nicolas Longchamps

About Me

Game Artist


Recent Forum Posts

PolyExtrude in VEX Feb. 4, 2019, 11:33 a.m.

Simple VEX inset. Run over prims.

vector centerPoint = v@P ;

int pts[] = primpoints(0,@elemnum);
int newPTS[] = {};

//generate inset points
foreach( int pt ; pts )

    vector pos = point(0,'P',pt);
    vector insetPos = lerp(pos,centerPoint,ch('inset'));
    int newPt = addpoint(0,insetPos);

//inset prim
int prCenter = addprim(0,'poly',newPTS);

//contour prims
for(int i=0; i<len(pts); i++)

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


//remove original prim

Ideally you also interpolate point and vertex attributes on the inset points.

can someone explain why twisting happens over only z-axis? Nov. 4, 2018, 12:25 p.m.

Its difficult to understand what you are trying to do with the limited info, but i'm guessing you mean the copied lines aren't “straight”.

Both these setups are causing axis flipping if you move the point over a specific axis. This is because the copy node only has a normal direction to use to orient the copies. The side and up vectors dont have a reference. If you're just randomly scattering geo this usually isnt a problem, but when you need to align things perfectly you need to either supply reference directions or build your own transform or orient attributes so the copy node knows exactly how to align the copies.

See here: []

You could try setting an up vector in the point wrangle before your copy sop.
ie v@up = {0,1,0};
The side vector would then be the cross product of N and up. So you will get axis flipping if N and up are aligned.

Polybevel on polyline? Oct. 23, 2018, 10:08 p.m.

Ran into this the other day. Polybevel seems sensitive to point/vertex ordering.

Your vertex order is different from your point order. Adding a sort node with sorting set to “by vertex order” will fix the issue. You can also fix the vertex order by changing how you wired them together in your “polyline_90_turn” wrangle. There you call addpoint in top-mid-bottom order, but then call addvertex in bottom-mid-top order.