transform
Syntax
Description
Examples
Apply Rigid 3-D Transformation to Surface Mesh
Define mesh vertices for a surface mesh.
vertices = [1 -1 1; 1 1 1; -1 1 1; -1 -1 1; ...
1 -1 -1; 1 1 -1; -1 1 -1; -1 -1 -1];
Define the mesh faces using the vertices.
faces = [6 2 1; 1 5 6; 8 4 3; 3 7 8; 6 7 3; 3 2 6; ...
5 1 4; 4 8 5; 4 1 2; 2 3 4; 7 6 5; 5 8 7];
Create and display the surface mesh.
mesh = surfaceMesh(vertices,faces);
surfaceMeshShow(mesh,Title="Original Mesh")
Define rotation and translation values, then use them to generate a transformation matrix.
theta = 30; rotationMat = [cosd(theta) sind(theta) 0; -sind(theta) cosd(theta) 0; 0 0 1]; translationVector = [2 0 0]; tform = rigidtform3d(rotationMat,translationVector);
Apply the rigid transformation and visualize the output.
transform(mesh,tform);
surfaceMeshShow(mesh,Title="Transformed Mesh")
Input Arguments
mesh
— Surface mesh
surfaceMesh
object
Surface mesh, specified as a surfaceMesh
object.
tform
— Rigid 3-D transformation matrix
rigidtform3d
object
Rigid 3-D transformation matrix, specified as a rigidtform3d
object.
Version History
Introduced in R2022b
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)