| Contents | Index |
creates the 3D box
![]()
produces the same box.
Calls:
plot::Box(
..
,
..
,
..
, <a = amin .. amax>, Options)
plot::Box([
,
,
], [
,
,
], <a = amin .. amax>, Options)
Parameters:
|
|
the lower borders: numerical real values or arithmetical expressions of the animation parameter a. |
|
|
the upper borders: numerical real values or arithmetical expressions of the animation parameter a. |
Related Domains:
plot::Polygon3d, plot::Rotate3d, plot::Scale3d, plot::Surface, plot::Transform3d
Related Functions:
Details:
plot::Box creates 3D boxes with edges parallel to the coordinate axes. Using plot::Rotate3d or plot::Transform3d one can create boxes and parallelepipeds with arbitrary orientation. Cf. examples 3 and 4.
Example 1
We draw a box consisting of its edges and a filled box:
plot(plot::Box(-3..-1, 0..2, 0..1, Filled = FALSE,
LineColor = RGB::Black),
plot::Box(1..3, 0..2, 0..1, Filled = TRUE,
FillColor = RGB::Red),
Axes = None, Scaling = Constrained)

Example 2
The borders of a box can be animated:
plot(plot::Box([1, 1, 1], [2, 2, 2 + sin(r)], r = 0..2*PI)):


Example 3
We want to display a cube “standing” on one of its corners. First, we define the cube:
b0 := plot::Box(0..1, 0..1, 0..1)
![]()
Now, rotating the cube to stand on a corner is equivalent to first rotating around the
-axis by 45 degrees, then rotating around the
-axis:
b1 := plot::Rotate3d(b0, Axis = [1, 0, 0], Angle = -PI/4):
plot(b1, Scaling = Constrained)

b2 := plot::Rotate3d(b1, Axis = [0, 1, 0], Angle = 7*PI/36):
plot(b2, Scaling = Constrained)

Finally, we let it rotate around the
-axis:
plot(plot::Rotate3d(b2, Axis = [0, 0, 1], Angle = a,
a = 0..2*PI/3),
Scaling = Constrained)


delete b0, b1, b2:
Example 4
A parallelepiped can be obtained from a plot::Box by a linear transformation:
plot(plot::Transform3d([0, 0, 0], [1, 1, 0,
1, 1, 3,
0, 3, 1],
plot::Box(0..1, 0..1, 0..1)),
Scaling = Constrained,
CameraDirection = [-27, -12, 22])


Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |