创建几何体小知识:
(1)几何体创建后访问其属性。不能使用Mesh点属性。必须使用geometry.parameters.width
Segments:片数,段数
(2)带有Segments属性的参数一般改变几何体的三角面。可以有效的增加cpu的利用率
(3)类似圆柱几何体,设置半径radius属性小于0。需要材质设置THREE.Doule否则看不到立方体
(4)二维图形需要将平面x轴旋转 - 0.5*Math.PI (90°) => PI = Π
三维图形(圆柱或者管)将材质设置成THREE.Doule
几何体 | 属性 |
THREE.PlaneGeometry(二维矩形) | width(长),height(宽),widthSegments,widthSegments |
THREE.CircleGeometry(二维圆) | radius(半径),thetaStart(起始),thetaLength(范围),segments |
THREE.RingGeometry(圆环) | innerRadius(内径),outerRadius,thetaSegments,phiSegments,thetaStart,thetaLength |
THREE.ShapeGeometry(自定义平面) | 根据函数描述自己所需平面图形 |
THREE.BoxGeometry(立方体) | width,height,depth,widthSegments,heightSegments,depthSegments |
THREE.SphereGeometry(球) | radius,widthSegments(数值向上分段数),heightSegments,phiStart(定义x轴绘制起始点),phiLength(绘制大小),thetaStart(y轴),thetaLength(y轴大小) |
THREE.CylinderGeometry(类似圆柱) | radiusTop(顶半径),radiusBottom(底半径),height,radialSegments,heightSegments,openEnded(指定网格顶部底部是否封闭) |
THREE.ConeGeometry(圆锥) | 同上相似,少了一个顶半径 |
THREE.TorusGeometry(圆环) | radius,tube,arc(设置圆环大小) |
THREE.TorusKnotGeometry(环状扭结) | |
THREE.PolyhedronGeometry(自定义) | radius(多面体顶点),detail(面熟) |
THREE.IcosahedronGeometry(20面体) | |
THREE.TetrahedronGeometry(4面体) | |
THREE.OctahedronGeometry(8面体) | |
THREE.DodecahedronGeometry(12面体) |