复杂模型计算时间过长
This commit is contained in:
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
36
index.html
36
index.html
@@ -37,15 +37,33 @@
|
|||||||
//);
|
//);
|
||||||
//scene.add(螺丝帽模型);
|
//scene.add(螺丝帽模型);
|
||||||
|
|
||||||
// 添加育苗盘
|
setTimeout(() => {
|
||||||
const 育苗盘模型 = new THREE.Mesh(
|
// 添加育苗盘
|
||||||
new 方形育苗盘(),
|
console.log('添加育苗盘');
|
||||||
new THREE.MeshStandardMaterial({ color: 0x0000ff, roughness: 0.5, metalness: 0.8 })
|
const 育苗盘模型 = new THREE.Mesh(
|
||||||
);
|
new 方形育苗盘(),
|
||||||
// 旋转育苗盘
|
new THREE.MeshStandardMaterial({ color: 0x0000ff, roughness: 0.5, metalness: 0.8 })
|
||||||
育苗盘模型.rotation.x += 1.57;
|
);
|
||||||
育苗盘模型.rotation.y += 0;
|
// 旋转育苗盘
|
||||||
scene.add(育苗盘模型);
|
console.log('旋转育苗盘');
|
||||||
|
育苗盘模型.rotation.x += 1.57;
|
||||||
|
育苗盘模型.rotation.y += 0;
|
||||||
|
scene.add(育苗盘模型);
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
//new Promise((resolve) => {
|
||||||
|
// // 添加育苗盘
|
||||||
|
// const 育苗盘模型 = new THREE.Mesh(
|
||||||
|
// new 方形育苗盘(),
|
||||||
|
// new THREE.MeshStandardMaterial({ color: 0x0000ff, roughness: 0.5, metalness: 0.8 })
|
||||||
|
// );
|
||||||
|
// // 旋转育苗盘
|
||||||
|
// 育苗盘模型.rotation.x += 1.57;
|
||||||
|
// 育苗盘模型.rotation.y += 0;
|
||||||
|
// scene.add(育苗盘模型);
|
||||||
|
// resolve();
|
||||||
|
//});
|
||||||
|
|
||||||
|
|
||||||
// 添加光源
|
// 添加光源
|
||||||
scene.add(new THREE.AmbientLight(0x404040, 1)); // 环境光,柔和的白光
|
scene.add(new THREE.AmbientLight(0x404040, 1)); // 环境光,柔和的白光
|
||||||
|
@@ -2,7 +2,7 @@ import * as THREE from 'three';
|
|||||||
import { SUBTRACTION, ADDITION, Brush, Evaluator } from 'three-bvh-csg';
|
import { SUBTRACTION, ADDITION, Brush, Evaluator } from 'three-bvh-csg';
|
||||||
|
|
||||||
export class 方形育苗盘 extends THREE.BufferGeometry {
|
export class 方形育苗盘 extends THREE.BufferGeometry {
|
||||||
constructor(width = 0.6, depth = 0.4, height = 0.01, holeDiameter = 0.02, holeRadius = .1, holeRows = 20, holeCols = 12, rowSpacing = .01, colSpacing = .01) {
|
constructor(width = 0.9, depth = 0.4, height = 0.01, holeDiameter = 0.02, holeRadius = .1, holeRows = 24, holeCols = 12, rowSpacing = .005, colSpacing = .005) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.parameters = {
|
this.parameters = {
|
||||||
|
Reference in New Issue
Block a user