word里怎么画三棱锥,word基本棱锥图怎么增加层数

首页 > 经验 > 作者:YD1662024-02-12 03:54:14

7. 榫卯体(LatheGeometry)2.7.1 榫卯体

榫卯体又称为旋转体,是通过旋转二维轮廓形状而成的三维几何体。LatheGeometry 的构造函数接受两个主要参数:路径(轮廓)和细分层级。

构造函数:

THREE.LatheGeometry(points, segments, phiStart, phiLength)

参数说明:

2.7.2 代码示例

// 定义轮廓的点 const points = []; for (let i = 0; i < 10; i ) { const x = Math.sin(i) * 2; const y = (i - 10)*0.5 ; points.push(new THREE.Vector2(x, y)); } // 创建线条几何体,这个几体体只是为了方便查看轮廓点的位置 const geometry = new THREE.BufferGeometry().setFromPoints(points); // 创建线条材质 const material1 = new THREE.LineBasicMaterial({ color: 0x00ff00 }); // 创建线条对象 const line = new THREE.Line(geometry, material1); scene.add(line); line.rotation.x = 1; line.rotation.y = 0; line.rotation.z = 0; // 完成线条几何体的创建 // 基于上面的线段创建 LatheGeometry const latheGeometry = new THREE.LatheGeometry(points, 50); const material = new THREE.MeshBasicMaterial({ color: 0xFF2222, wireframe: true }); const myGeometry = new THREE.Mesh(latheGeometry, material); scene.add(myGeometry);

word里怎么画三棱锥,word基本棱锥图怎么增加层数(9)

8. 八面体(OctahedronGeometry)2.8.1 构造函数

THREE.OctahedronGeometry(radius, detail) 2.8.2 代码

const radius =1; const detail = 0; const octahedronGeometry = new THREE.OctahedronGeometry(radius, detail); const material = new THREE.MeshBasicMaterial({ color: 0x00ffff, wireframe: true }); const myGeometry = new THREE.Mesh(octahedronGeometry, material); scene.add(myGeometry);

word里怎么画三棱锥,word基本棱锥图怎么增加层数(10)

9. 环几何体(RingGeometry)2.9.1 构造函数

THREE.RingGeometry(innerRadius, outerRadius, thetaSegments, phiSegments)

参数说明:

2.9.2 示例

const innerRadius = 1; const outerRadius = 2; const thetaSegments = 8; const phiSegments = 8; const ringGeometry = new THREE.RingGeometry(innerRadius, outerRadius, thetaSegments, phiSegments); const material = new THREE.MeshBasicMaterial({ color: 0x00ff00, wireframe: true }); const myGeometry = new THREE.Mesh(ringGeometry, material); scene.add(myGeometry);

word里怎么画三棱锥,word基本棱锥图怎么增加层数(11)

10. 四面体(TetrahedronGeometry)2.10.1 构造函数

THREE.TetrahedronGeometry(radius, detail, type)

2.10.2 示例

const radius = 2; const detail = 0; const type = 'regular'; const tetrahedronGeometry = new THREE.TetrahedronGeometry(radius, detail, type); const material = new THREE.MeshBasicMaterial({ color: 0x00ff00, wireframe: true }); const myGeometry = new THREE.Mesh(tetrahedronGeometry, material); scene.add(myGeometry);

word里怎么画三棱锥,word基本棱锥图怎么增加层数(12)

上一页12345下一页

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.