How to create gradient colored mesh or surface like matlab in babylon?

how to create gradient colored mesh or surface like matlab in babylon? how to do that, Is there a demo?
example:

[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
mesh(X,Y,Z)
surf(X,Y,Z)

mesh

surf

Some examples of how it could be achieved.

Wireframe Babylon.js Playground

Using gridMaterial - https://playground.babylonjs.com/#PVJR78#1

Colored wireframe https://playground.babylonjs.com/#PVJR78#2

3 Likes

https://playground.babylonjs.com/#JKUDMY#2
image

Then you would prolly need to use Barycentric Genration? this too to get the black lines with the color too.

7 Likes

thank you!