使用 Mathematica 中的图形以 3D 形式显示多个 2D 绘图? [英] Display multiple 2D plots in 3D using Graphics in Mathematica?

查看:30
本文介绍了使用 Mathematica 中的图形以 3D 形式显示多个 2D 绘图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑以下几点:

lalist = {{{{1, 1}, 1}, {{3, 3}, 1}, {{5, 5}, 1}},
          {{{1, 5}, 1}, {{3, 3}, 1}, {{5, 1}, 1}}}

Row[{
  Graphics[{
            Opacity[0.5],Red, 
            Disk @@@ lalist[[1]]}, 
            Frame -> True],
  Graphics[{
            Opacity[0.5],Blue, 
            Disk @@@ lalist[[2]]}, 
            Frame -> True]}
    ]

  • 我是否有可能绘制蓝调3D 中红色磁盘后面"的磁盘情节?

下面不是我需要的:

推荐答案

喜欢这个吗?

Graphics3D[{{Texture[
 Graphics[{Opacity[0.5], Blue, Disk @@@ lalist[[2]]}, 
  Frame -> True]], 
 Polygon[{{-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1}}, 
 VertexTextureCoordinates [Rule] {{0, 0}, {1, 0}, {1, 1}, {0, 
    1}}]}, {Texture[
 Graphics[{Opacity[0.5], Red, Disk @@@ lalist[[1]]}, 
  Frame -> True]], 
Polygon[{{-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1}}, 
 VertexTextureCoordinates [Rule] {{0, 0}, {1, 0}, {1, 1}, {0, 
    1}}]}}, Lighting [Rule] "Neutral"]

其中很多不透明度为 .2:

Lots of them with opacity .2:

tab = Table[{Opacity [Rule] .2, 
Texture[Graphics[{Opacity[0.5], Blue, Disk @@@ lalist[[2]]}, 
  Frame -> True]], 
Polygon[{{-1, -1, z}, {1, -1, z}, {1, 1, z}, {-1, 1, z}}, 
 VertexTextureCoordinates [Rule] {{0, 0}, {1, 0}, {1, 1}, {0, 
    1}}]}, {z, -2, 2, 1}];
plt = Graphics3D[{tab}, Lighting [Rule] "Neutral"]

和400在速度方面似乎没有太大问题(你可以很容易地修改上面的代码来查看).

and 400 don't seem to be much of a problem in terms of speed (you can easily modify the code above to see it).

好的,只是为了愚蠢,试试这个

OK, just to be silly, try this

Dynamic[Graphics3D[{{Texture[#], 
  Polygon[{{-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1}}, 
   VertexTextureCoordinates [Rule] {{0, 0}, {1, 0}, {1, 1}, {0, 
      1}}]}, {Texture[Rotate[#, [Pi]/2]], 
  Polygon[{{-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1}}, 
   VertexTextureCoordinates [Rule] {{0, 0}, {1, 0}, {1, 1}, {0, 
      1}}]}}, Lighting [Rule] "Neutral"] &@Binarize[CurrentImage[]]]

给出

(或类似的东西)、可旋转、实时更新等

(or something like that), rotatable, updated in real time etc.

这篇关于使用 Mathematica 中的图形以 3D 形式显示多个 2D 绘图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆