makehgtform
Create 4-by-4 transform matrix
Syntax
M = makehgtform
M = makehgtform('translate',[tx ty tz])
M = makehgtform('scale',s)
M = makehgtform('scale',[sx,sy,sz])
M = makehgtform('xrotate',t)
M = makehgtform('yrotate',t)
M = makehgtform('zrotate',t)
M = makehgtform('axisrotate',[ax,ay,az],t)
Description
Usemakehgtform
to create transform matrices for translation, scaling, and rotation of graphics objects. Apply the transform to graphics objects by assigning the transform to theMatrix
property of a parent transform object.
M = makehgtform
returns an identity transform.
M = makehgtform('translate',[tx ty tz])
or M = makehgtform('translate',tx,ty,tz) returns a transform that translates along thex-axis bytx
, along they-axis byty
, and along thez-axis bytz
.
M = makehgtform('scale',s)
返回一个尺度变换统一thex-,y-, andz-axes.
M = makehgtform('scale',[sx,sy,sz])
returns a transform that scales along thex-axis bysx
, along they-axis bysy
, and along thez-axis bysz
.
M = makehgtform('xrotate',t)
returns a transform that rotates around thex-axis byt
radians.
M = makehgtform('yrotate',t)
returns a transform that rotates around they-axis byt
radians.
M = makehgtform('zrotate',t)
returns a transform that rotates around thez-axis byt
radians.
M = makehgtform('axisrotate',[ax,ay,az],t)
Rotate around axis[ax ay az]
byt
radians.
Note that you can specify multiple operations in one call tomakehgtform
and the MATLAB®software returns a transform matrix that is the result of concatenating all specified operations. For example,
m = makehgtform('xrotate',pi/2,'yrotate',pi/2);
is the same as
mx = makehgtform('xrotate',pi/2); my = makehgtform('yrotate',pi/2); m = mx*my;