I have a 3d mesh and 11 static points with predefined values for them. Points are represented as an array of positions in 3d space and values:
x: 0.3 y: 0.4, z: 0.5, value: 100,
x: 0.6 y: 0.9, z: 0.66, value: 20,
x: 0.4 y: 0.22, z: 0.35, value: 50,
x: 0.11 y: 0.34, z: 0.65, value: 0,
x: 0.35 y: 0.65, z: 0.5, value: 0,
x: 0.22 y: 0.67, z: 0.5, value: 0,
x: 0.43 y: 0.22, z: 0.5, value: 0,
x: 0.67 y: 0.31, z: 0.5, value: 16,
x: 0.84 y: 0.34, z: 0.5, value: 13,
x: 0.22 y: 0.43, z: 0.5, value: 0,
x: 0.13 y: 0.24, z: 0.5, value: 11,
I want to color faces of my 3d mesh and to make that I need to add some value for each face, depending on how far are they from this points. I already know the position of each face, but how to find their values? Which interpolation method/approach shall I use?
For example this face x: 0.34, y: 0.43, z: 0.18, value: ?
Ideally, I'm looking for some js/three.js solution/library to perform it on the frontend or some other python library to process it on the backend?
I found a couple of methods, but they work only in 2 or support only interpolation between 2 points, but how to apply it for an array?