


Addvertex takes a prim id and a point id, and whatever order you add them in, defines the ordering of the sub-sections within the polyline.

You'd define an empty prim, then manually bind points to your prim with addvertex. Why this way? Well, this is the older method for creating prims I mentioned earlier. Then I define a point, and use a new thing, addvertex. In the loop I create an offset based on curlnoise, and a position based on that offset and the normal, stepsize, and current i value. This also has the benefit of keeping the main code you're doing a little cleaner, as you don't have vector/float/int definitions cluttering things.īefore the main loop, I initialise the new prim and store its id as 'pr', and create a stepsize. You can see that if you have multiple variables of a single type, you can define the type and then specify the names as a comma separated list, eg 'vector offset, pos, otherpos, mycolor ' etc. Here I've done something thats fairly common, which is to define all my variables up front.
