How is it possible to color a 3D shape /point cloud (in my case a human body), in such a way that each point has a different color but the color transition from point to point is smooth, as shown in the picture below?
The shape of N points is represented as an Nx3 array of point coordinates x,y,z. I tried to simply convert the coordinate values x,y,z of each point to r,g,b color values, but the result isn't satisfying (e.g. some points that are close to each other according to the Euclidean distance are colored by a similar color but they should be colored with different colors because their geodesic distance is large).
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
pc = ...
colors = (pc - pc.min()) / (pc.max() - pc.min())
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(pc[1], pc[1], pc[2], c=colors)
plt.show()

