Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 11 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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