// don't want side effects on neighboring triangles.
// This method gives a way to do both point and tiangle selection as an example.
// It should be quite straightforward to adapt according to the needs of a
// real application.
getColorForValue(data[currentVariable][triangles[idx[0]]],(closest==0) ? 0.1f : 0.5f).getRGBColorComponents(color);
colors.position(idx[0]*3);
colors.put(color);
getColorForValue(data[currentVariable][triangles[idx[1]]],(closest==1) ? 0.1f : 0.5f).getRGBColorComponents(color);
colors.position(idx[1]*3);
colors.put(color);
getColorForValue(data[currentVariable][triangles[idx[2]]],(closest==2) ? 0.1f : 0.5f).getRGBColorComponents(color);