Display multiple 2D plots in 3D with Graphics in Mathematica?

Given the following:

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

enter image description here

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

enter image description here

  • Is it possible for me to launch Blues Disks β€œfor” red in a 3 D plot?

Below is not what I need:

enter image description here

+7
source share
3 answers

Like this?

 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"] 

enter image description here

Many 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"] 

enter image description here

and 400 doesn't seem to be too complicated in terms of speed (you can easily change the code above to see it).

EDIT: OK, just to be stupid, 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[]]] 

which gives

enter image description here

(or something like that), rotation, real-time update, etc.

+10
source

See the solution presented at "Lunchtime Playground: Fun with Mathematica" here: http://mathgis.blogspot.com/2009/02/howto-display-2d-plot-in-3d.html

+9
source

Using transparent textures to render these circles in layers since the ACL does this is a good solution unless you want to interact with the resulting 3D object. Dressing 3D objects containing transparent elements is performed in software, whereas otherwise it would have been done in hardware :

3D rendering uses two different methods for sorting polygons. For graphic scenes that do not include transparency, hardware acceleration of the depth buffer. Otherwise, renderer uses the binary space tree partition to split and sort polygons from any perspective. The BSP tree is slower to create and not use hardware accelerates, but the overall ability to support polygons.

On my laptop, interacting with 3D graphics is incredibly slow as soon as transparent objects begin to appear.

The solution would be to use 3D disks instead of translucent planes with 2D disks in them. Since MMA does not have a 3D Disk or Circle , if you want to do something like this, you need to minimize it yourself. The bare-bones version will look something like this:

 myDisk[{x_, y_, z_}, r_] := Polygon@Table [ {x, y, z} + r {Cos[\[Phi]], Sin[\[Phi]], 0} // N, {\[Phi], 0, 2 \[Pi], 2 \[Pi]/200} ] 

Then your layers will be generated as follows:

 Graphics3D[ { EdgeForm[], { Red, myDisk[{1, 1, 0.5}, 0.5], myDisk[{0, 0, 0.5}, 0.5], myDisk[{-1, -1, 0.5}, 0.5] }, { Blue, myDisk[{1, -1, -0.5}, 0.5], myDisk[{0, 0, -0.5}, -0.5], myDisk[{-1, 1, -0.5}, 0.5]} } ] 

enter image description here

+4
source

All Articles