Code:

int count = [vertices count] * 8; GLVertices = (GLfloat *)malloc(count * sizeof(GLfloat)); int currIndex = 0; for (NSValue *locationValuetl in vertices) { CGPoint loc = locationValuetl.pointValue; GLVertices[currIndex++] = loc.x; GLVertices[currIndex++] = loc.y; } for (NSValue *locationValuetr in vertices) { CGPoint loc = locationValuetr.pointValue; GLVertices[currIndex++] = loc.x; GLVertices[currIndex++] = loc.y; } for (NSValue *locationValuell in vertices) { CGPoint loc = locationValuell.pointValue; GLVertices[currIndex++] = loc.x; GLVertices[currIndex++] = loc.y; } for (NSValue *locationValuelr in vertices) { CGPoint loc = locationValuelr.pointValue; GLVertices[currIndex++] = loc.x; GLVertices[currIndex++] = loc.y; } int distance1 = sqrt(GLVertices[currIndex - 1]*GLVertices[currIndex - 9] + GLVertices[currIndex]*GLVertices[currIndex - 8]); if (distance1 > brushSize/4) { //need to do something here

Image of current result:

Can someone help me?

Thanks in advance