7
$\begingroup$

I'm a bit new to the application, and I'm not sure how to draw a parallelepiped in Mathematica.

$\endgroup$
11
$\begingroup$

After version 9: Parallelepiped.

Graphics3D[Parallelepiped[{0, 0, 0}, {{1, 0, 0}, {1, 1, 0}, {0, 1, 1}}]]

enter image description here


Version 9 or before. Right from the documentation of ShearingMatrix, that is a GeometricTransformation:

Graphics3D[{GeometricTransformation[{Opacity[.85], Red, Cuboid[]}, 
   ShearingMatrix[Pi/4, {1, 0, 0}, {-1, 1, 0}]]}, Boxed -> False]

Mathematica graphics

A dynamic manipulator to understand arguments:

Manipulate[
 Graphics3D[{
   GeometricTransformation[{Opacity[.85], Red, Cuboid[]}, 
    ShearingMatrix[a, dir, {x, y, z}]]
   }, FaceGrids -> {{-1, 0, 0}, {0, 1, 0}, {0, 0, -1}}, Axes -> True, 
  Boxed -> False, BoxRatios -> 1, SphericalRegion -> True],

 {{a, Pi/4}, -Pi/2, Pi/2, Appearance -> "Labeled"},
 {{dir, {0, 1, 0}, "direction"}, {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}},
 {{x, -1}, -1, 1, .1, Appearance -> "Labeled"},
 {{y, 1}, -1, 1, .1, Appearance -> "Labeled"},
 {{z, 0}, -1, 1, .1, Appearance -> "Labeled"},
 ControlPlacement -> Left
 ]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.