I'm making a patch where I take data from a external device and create a 8x8 cellblock table from it, with data values inside each cell. At the push of a button, I dump the x and y position of each cell, along with the corresponding data point, and send it to a 3 plane matrix (one plane for x, y, and z (data value)). I then send this data to a jit.gl.mesh to be rendered/visualized as a 3D "topography map" where the x and y position of each vertex is set by the x and y planes, and the height of each vertex is set by the z plane (data values plane).Data values can be in the range from 0-127.
What I'm getting right now is something that looks like the image attaceched (with auto_color attribute of jit.gl.mesh set to "ON").
What I want to do now is color each vertex based only on it's height. In other words, I want to map the values in the Z plane (data values plan) to the RGB value of each vertex, in such a way that the color of a vertex can go through the entire spectrum of colors, depending on the data value (the height of the vertex in the Z plane), which is bound from 0-127. In the end the data should be visualized like a colored topography map (see second attached image, generated by excel).
Does anyone know of a general approach to doing this?
Specifically, I'm also wondering where I can find more information on the color_mode attribute of jit.gl.mesh, because the reference says hardly anything about them, or how to use them.
Can I use a jit.op object to adjust the RGB plane values through an equation based on the Z plane values?