【问题标题】:Coloring of surfaces in 3D with Mathematica使用 Mathematica 为 3D 表面着色
【发布时间】:2013-02-03 18:01:18
【问题描述】:

我有一个 3D 点云。使用带有 ListPlot3D 函数的 Mathematica 很容易绘制它们。上色对我来说有点困难。我想得到这样的结果:

SphericalPlot3D[
 1 + Sin[-5 \[Phi]] Sin[-5 \[Theta]]/10, {\[Theta], 
  0, \[Pi]}, {\[Phi], 0, 2 \[Pi]}, 
 ColorFunction -> (ColorData["Rainbow"][#6] &), Mesh -> None, 
 PlotPoints -> 30, Boxed -> False, Axes -> False]

这样颜色就会显示到中心的径向距离。有可能做到吗?我也有非常接近球形的数据云,更准确地说是带有凸起的球形帽。

【问题讨论】:

    标签: image colors wolfram-mathematica


    【解决方案1】:

    你可以这样做:

    nPoints = 10^3;
    SeedRandom[7];
    data = CoordinateTransformData["Spherical" -> "Cartesian", "Mapping", #] & /@ 
      Transpose[{1 + RandomReal[{-0.15, 0.15}, nPoints], RandomReal[{0, Pi}, nPoints], RandomReal[{-Pi, Pi}, nPoints]}];
    
    ListSurfacePlot3D[data, 
     ColorFunction -> (ColorData["Rainbow"][EuclideanDistance[{0, 0, 0},{#1, #2, #3}]] &), 
     ColorFunctionScaling -> False, Mesh -> None, Boxed -> False, Axes -> False]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-25
      • 1970-01-01
      • 2021-12-03
      • 2018-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多