Re: 3D vector plots and shading
- To: mathgroup at smc.vnet.net
- Subject: [mg21477] Re: [mg21460] 3D vector plots and shading
- From: "David Park" <djmp at earthlink.net>
- Date: Tue, 11 Jan 2000 04:17:55 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
>Hi, > >I have been trying to plot a 3D vector field inside a box >with one half shaded gray. I have tried combining the >ListPlotVectorField3D output and a cuboid (GrayLevel[0.8]) >using the Show command but the cuboid obscures the >vector field. Does anyone have any idea as to how I could >display the vector field on TOP of the shaded cuboid? >Is there another way to shade 1/2 of the region of the vector >field? > >Thanks much, > >Keith > Keith, Even if you could manage to draw the vector field AFTER drawing the cuboid, the vectors would still be hidden within the cuboid. It is quite easy to get the kind of representation you wish using my DrawingCube packages available at my web site. I used the vector field example from page 205 in the Standard Add-On Packages book (Graphics`PlotField3D` section). I drew the vector field in Red from x = 0 to x = 1, and in Blue from x = 1 to x = 2. I used Polygon to put an AliceBlue background behind the first field and a MistyRose background behind the second field. I then added a see through WireFrame plane between the two fields. Here is the code. The first four packages are some of the DrawingCube packages. << Graphics`DrawingCube` << Graphics`DrawingField3D` << Graphics`ParametricDrawing3D` << Graphics`DrawingShapes` << Graphics`Colors` Show[Graphics3D[ {Blue, DrawVectorField3D[{x, y, z}, {x, 0, 1}, {y, 0, 2}, {z, 0, 2}, VectorHeads -> True], Red, DrawVectorField3D[{x, y, z}, {x, 1, 2}, {y, 0, 2}, {z, 0, 2}, VectorHeads -> True], AliceBlue, Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 2, 0}, {0, 2, 0}}], Polygon[{{0, 2, 0}, {1, 2, 0}, {1, 2, 2}, {0, 2, 2}}], Polygon[{{0, 0, 0}, {0, 2, 0}, {0, 2, 2}, {0, 0, 2}}], MistyRose, Polygon[{{1, 0, 0}, {2, 0, 0}, {2, 2, 0}, {1, 2, 0}}], Polygon[{{1, 2, 0}, {2, 2, 0}, {2, 2, 2}, {1, 2, 2}}], Black, UseWireFrame[ ParametricDraw3D[{1, y, z}, {y, 0, 2}, {z, 0, 2}, PlotPoints -> 11]]}], AspectRatio -> Automatic, PlotRange -> {{0, 2}, {0, 2.001}, {0, 2}}, {ImageSize -> 400, Lighting -> False}]; David Park djmp at earthlink.net http://home.earthlink.net/~djmp/