个性化阅读
专注于IT技术分析

MATLAB 3D函数fill3()

fill3函数可创建平面阴影和Gouraud阴影多边形。

句法

fill3(X, Y, Z, C) // It fills three-dimensional polygon. X, Y, and Z triplets specify a polygon vertices. If X, Y, or Z is a matrix, fill3 develop n polygons, where n is a number of columns in the matrix. fill3 close the polygons by linking the last vertex to the first when necessary.
C specifies color, where C is the vector or matrix of indices into the current colormap. If C is the row vector, length(C) must same size(X, 2) and size(Y, 2); if C is the column vector, length(C) must same size(X, 1) and size(Y, 1).
fill3(X, Y, Z, ColorSpec) // It fills three-dimensional polygons defined by X, Y, and Z with color specified by ColorSpec.
fill3(X1, Y1, Z1, C1, X2, Y2, Z2, C2, ...) // It specifies multiple filled three-dimensional areas.
fill3(..., 'PropertyName', PropertyValue) // It allows us to set values for specific patch properties.
h = fill3(...) // It returns a vector of handles to patch graphics objects, one handle per patch.

例子

四个具有三个顶点的填充多边形的图。

X= [0 0 0 0; 1 1 -1 1; 1 -1 -1 -1];
Y= [0 0 0 0; 4 4 4 4; 4 4 4 4];
Z= [0 0 0 0; 1 1 -1 -1; -1 1 1 -1];
fillcolor= rand(3, 4);
fill3 (X, Y, Z, fillcolor)
view (120, 30)

输出

MATLAB fill3()

赞(0)
未经允许不得转载:srcmini » MATLAB 3D函数fill3()

评论 抢沙发

评论前必须登录!