RE: RotateShape[Cuboid...

• To: mathgroup at smc.vnet.net
• Subject: [mg27240] RE: [mg27220] RotateShape[Cuboid...
• From: "David Park" <djmp at earthlink.net>
• Date: Tue, 13 Feb 2001 03:35:46 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```This is because RotateShape and the other graphic transforms work only on
graphics objects built out of Points and Lines and Polygons. Cuboid is drawn
using more primitive graphics code and is not susceptible to such
transformations.

If you build up your cube by combining Polygons you can rotate them. Here is
an example with a partial cube.

side1 = Polygon[{{0, 0, 0}, {0, 1, 0}, {0, 1, 1}, {0, 0, 1}}];
side2 = Polygon[{{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}}];
side3 = Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}];
side4 = Polygon[{{0, 1, 0}, {1, 1, 0}, {1, 1, 1}, {0, 1, 1}}];
cube = {side1, side2, side3, side4};

Show[Graphics3D[cube] ,
RotateShape[Graphics3D[cube],
Pi/4, 0, 0]];

David Park

> From: roelb [mailto:roelb at club-internet.fr]
To: mathgroup at smc.vnet.net
>
> Hi,
> On Mathematica3 for mac, the following input produces 2 rods crossing
> with a 90° angle, as expected. That's OK.
>
> Show[Graphics3D[Cylinder[.3,1,10] ],RotateShape[
>          Graphics3D[Cylinder[.3,1,10 ] ],
>                   0,Pi/2,0]]
>
> But a quite similar RotateSphape input applied to Cuboids doesn't behave
> in the same manner. Why? (I expected the top Cudoid being oriented
> differently than the botton one).
>
> Show[Graphics3D[Cuboid[{-1,-1,0},{1,1,1}]] ,
>   RotateShape[Graphics3D[Cuboid[{-1,-1,1},{1,1,2}]],
>                  0,1,0]]
>
> The mathematica book state that cuboids faces are parallel to the axes.
> Should it means that RotateShape doesn't apply?
>

```

• Prev by Date: Re: Urgent
• Next by Date: Re: Re: Plotting Intersecting Planes