Re: Help with Graphics
- To: mathgroup at smc.vnet.net
 - Subject: [mg6853] Re: [mg6817] Help with Graphics
 - From: Xah Lee <xah at best.com>
 - Date: Thu, 24 Apr 1997 02:44:32 -0400 (EDT)
 - Sender: owner-wri-mathgroup at wolfram.com
 
At 2:02 AM -0400 4/21/97, Dr. Sergio Terrazas wrote:
>...
>I want to generate a 3-Dimensional
>grid of n x n x n (empty) boxes at first, and then, if the center point
>of a box is inside the region of integration,then show those boxes filled
>(using Cuboid[])
>...
One somewhat more symmetric way to generate a 3d grid is by drawing half a
box at each grid point, then map the space with these frames.
Example:
Clear[gridFrame, myGraPrim];
gridFrame::usage="gridFrame[3DPoint,sideLength] returns a list of Line
graphic primitives that represents a box of sidelength and one corner at
3DPoint. Example: gridFrame[{a,b,c},s]"
gridFrame[p_,s_]:=
  Module[{},{Line/@(Transpose[{#,#+DiagonalMatrix[{s,s,s}]}&@Table[p,{3}]])}]
myGraPrim=Table[gridFrame[{i,j,k},1],{i,4},{j,3},{k,2}];
Show[Graphics3D[{Hue[0],myGraPrim}],AspectRatio->Automatic,Boxed->False,
  Axes->True,ViewPoint->{1.354, -2.758, 1.418}];
Other ways of generating a grid may be drawing continuous lines from end to
end. This is somewhat unsymmetric and unflexible. Or, you can generate a
complete box at each point, but then neighboring grids overlap.
 Xah
 xah at best.com
 http://www.best.com/~xah/SpecialPlaneCurves_dir/specialPlaneCurves.html
 Mountain View, CA, USA