显示多个2D绘图的3D图形使用Mathematica中? [英] Display multiple 2D plots in 3D using Graphics in Mathematica?
本文介绍了显示多个2D绘图的3D图形使用Mathematica中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
考虑以下内容:
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]}
]
- 难道我绘制蓝军 磁盘背后的红色的在三维 情节?
- Is it possible that I plot the Blues Disks "behind" the red ones in a 3 D plot ?
下面是不是我所需要的:
Below is not what I need :
推荐答案
喜欢这个?
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"]
很多人不透明度0.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似乎并没有太大的问题,在速度方面(你可以很容易地修改上面的code才能看到它)。
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.
这篇关于显示多个2D绘图的3D图形使用Mathematica中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文