MATLAB 3D 动画制作(一)- 3D 图形设计
前言:本系列教程将逐步完成一个有趣的MATLAB 3D动画,MATLAB 3D图形的绘制和3D动画的制作可以让工程人员很直观地展示工作内容,特别是在虚拟现实,控制系统设计,人机交互,计算机视觉,等领域都能得到应用。
Introduction: This series of tutorials are going to discuss a process of making 3D animation using MATLAB step by step. The 3D animation in MATLAB can let the engineers exhibit their work. It can be used widely, especially at the fields of Virtual Reality, Control system Designing, Human-machine interactivity, Computer Vision, etc.
首先介绍一下本教程的最终效果:
Below is the final effect of this 3D animation.
Section 1: 3D Object Designing (3D 图形设计)
In this section, We are going to discuss the approach to build the 3D object in MATLAB figure window. We are going to begin with the simple object like sphere, bar, cylinder, torus. And we also discuss make a more complicated 3D object by assembling these simple 3D object together.
1.1 introduction to the Tools we are going to use:
- surf function in MATLAB
- cylinder function in MATLAB
- sphere function in MATLAB
1.1.1 surf function in MATLAB
surf(X,Y,Z) uses Z for the color data and surface height. X and Y are vectors or matrices defining thex and y components of a surface. If X and Y are vectors, length(X) = n and length(Y) = m, where[m,n] = size(Z). In this case, the vertices of the surface faces are