绘制一个平面。
平面是一个四边形,每个角度都是 90˚ 的平坦形状。它类似于矩形,并在 WebGL 模式下提供高级绘图功能。
第一个参数 width 是可选的。如果传递一个 Number,如 plane(20), 它设置平面的宽度和高度。默认情况下,width 是 50。
第二个参数 height 也是可选的。如果传递一个 Number,如 plane(20, 30), 它设置平面的高度。默认情况下,height 设置为平面的 width。
第三个参数 detailX 也是可选的。如果传递一个 Number,如 plane(20, 30, 5), 它设置沿 x 轴使用的三角形细分数。所有 3D 形状都是通过连接三角形来形成其表面的。默认情况下,detailX 是 1。
第四个参数 detailY 也是可选的。如果传递一个 Number,如 plane(20, 30, 5, 7), 它设置沿 y 轴使用的三角形细分数。所有 3D detailY 是 1。
注意:plane() 只能在 WebGL 模式下使用。
示例
语法
plane([width], [height], [detailX], [detailY])
参数
width
Number:
width of the plane.
height
Number:
height of the plane.
detailX
Integer:
number of triangle subdivisions along the x-axis.
detailY
Integer:
number of triangle subdivisions along the y-axis.
This page is generated from the comments in src/webgl/3d_primitives.js . Please feel free to edit it and submit a pull request!