JoyOfVex14

From cgwiki
Revision as of 04:46, 14 February 2018 by MattEstela (talk | contribs) (Created page with "=== Create geometry === For once I promise not to do ramp falloffs or waves. :) Vex can create points with the addpoint command. Like a lot of functions in vex you have to d...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Create geometry

For once I promise not to do ramp falloffs or waves. :)

Vex can create points with the addpoint command. Like a lot of functions in vex you have to define the geometry to output to (always 0, ie, the first geo, ie 'this' geometry), and a position. It returns an integer, which represents a ptnum you can refer to later.

int pt = addpoint(0, {0,3,0});

Running that on the grid will create what looks like a single point above the grid, at 0,3,0. But remember that this a point wrangle runs this code in parallel on all the points, so what you really have is a ton of points all bunched up at the same point (you can verify this by middle-mouse-button hold on the wrangle, and look at the number of points, vs the number of points in the original grid.

As a quick aside, you could collapse this down to a single point afterwards with a fuse sop, or try and control when the addpoint function runs, so it only fires on a single point. Eg:

if (@ptnum==0) {
  addpoint(0, @P+{0,1,0});
}

Or better still, use the group field at the top of the wrangle to limit it to run on a single point (just type 0 into that field)

(image)