# random point in the algorithm of Delaunay

Hi! im bilding a mesh with vector and ofx delaunay using this standart algorithm

``````
#include "ofxDelaunay.h"

void ofxDelaunay::reset(){
vertices.clear();
triangles.clear();
triangleMesh.clear();
}

int ofxDelaunay::addPoint( const ofPoint& point ){
return addPoint( point.x, point.y, point.z );
}

int ofxDelaunay::addPoint( float x, float y, float z ){
XYZ v;
v.x = x;
v.y = y;
v.z = z;
vertices.push_back(v);
return vertices.size();
}

for(int i = 0; i < points.size(); i++){
}
return vertices.size();
}

int ofxDelaunay::triangulate(){

int nv = vertices.size();
//add 3 emptly slots, required by the Triangulate call
vertices.push_back(XYZ());
vertices.push_back(XYZ());
vertices.push_back(XYZ());

//allocate space for triangle indices
triangles.resize(3*nv);

int ntri;
qsort( &vertices[0], vertices.size()-3, sizeof( XYZ ), XYZCompare );
Triangulate( nv, &vertices[0], &triangles[0], ntri );

// copy triangle data to ofxDelaunayTriangle.
triangleMesh.clear();

//copy vertices
for (int i = 0; i < nv; i++){
}

//copy triagles
for(int i = 0; i < ntri; i++){
}

return ntri;
}

void ofxDelaunay::draw(){
if(ofGetStyle().bFill){
triangleMesh.draw();
}
else{
triangleMesh.drawWireframe();
}
}

``````

and app build felicitously
but the construction of the points consistent, and built equal triangles.
how can i set random point, and build something like this image?

hm, could you post a code snippet that shows how youÂ´re using ofxDelauny ?
greetings ascorbin