%% Create and Visualize Box Collision Geometry
% Create a box collision geometry centered at the origin. The side lengths in the x-, y-, and z-directions are 3, 1, and 2 meters, respectively.

box = collisionBox(3,1,2)

%
% Visualize the box.

show(box)
title('Box')

% Create two homogeneous transformation matrices. The first matrix is a rotation about the z-axis by \pi/2 radians, and the second matrix is a rotation about the x-axis of \pi/8 radians.

matZ = axang2tform([0 0 1 pi/2]);
matX = axang2tform([1 0 0 pi/8]);

%
% Create a second box collision geometry with the same dimensions as the first. Change its pose to the product of the two matrices. The product corresponds to first rotation about the z-axis followed by rotation about the x-axis. Visualize the result.

box2 = collisionBox(3,1,2);
box2.Pose = matZ*matX;
show(box2)
title('Box2')

% Copyright 2019 The MathWorks, Inc.