惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
博客园 - 司徒正美
小众软件
小众软件
H
Help Net Security
博客园 - 聂微东
宝玉的分享
宝玉的分享
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
U
Unit 42
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题
腾讯CDC
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
J
Java Code Geeks
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Martin Fowler
Martin Fowler
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News

时间的朋友

Windows 命令行密码重置 Anaconda安装 typescript 注解解读1 Konvajs Shape加载自定义图片 sshpass 使用 why-is-node-running webgl笔记 SharedArrayBuffer is not defined blender 常用快捷键 | 时间的朋友 vue -- v3.4commit提交记录2 vue2 升级vue3报错问题整理 着色器 expressjs 源码 hyper-V arch linux 网络配置 element input数字格式化 WebAudio笔记 Windows nginx重启bat脚本 vue -- v3.4commit提交记录 URI malformed vue3 -- Class 对象在组件中使用范例 | 时间的朋友 ruby 安装和升级 element-plus 老版本cascader使用卡死问题 vue3 内置Transition组件 | 时间的朋友 前端memo的实现 | 时间的朋友 Vue -- vue-class-component源码 | 时间的朋友 linux 优化脚本 typescript 装饰器 | 时间的朋友 microbundle 源码 | 时间的朋友 WSL2问题解决WslRegisterDistribution failed with error: 0x800701bc vue -- vue3利用createVNode函数,建立命令式调用组件 | 时间的朋友
three 拼接货架
2024-02-24 · via 时间的朋友
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
const PILLAR_WIDTH = 2;
const COLOR = 0x666666;
const SHELF_HEIGHT = 150;
const SHELF_LENGTH = 100;
const SHELF_WIDTH = 50;

function createshelve(scene) {
  // 柱子
  const pillar1 = new Mesh(
    new BoxGeometry(PILLAR_WIDTH, SHELF_HEIGHT, PILLAR_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar1.position.x = -SHELF_LENGTH / 2;
  pillar1.position.y = 0;
  scene.add(pillar1);

  const pillar2 = new Mesh(
    new BoxGeometry(PILLAR_WIDTH, SHELF_HEIGHT, PILLAR_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar2.position.x = -SHELF_LENGTH / 2;
  pillar2.position.z = -SHELF_WIDTH;
  scene.add(pillar2);

  const pillar3 = new Mesh(
    new BoxGeometry(PILLAR_WIDTH, SHELF_HEIGHT, PILLAR_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar3.position.x = SHELF_LENGTH / 2;
  pillar3.position.y = 0;
  scene.add(pillar3);

  const pillar4 = new Mesh(
    new BoxGeometry(PILLAR_WIDTH, SHELF_HEIGHT, PILLAR_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar4.position.x = SHELF_LENGTH / 2;
  pillar4.position.z = -SHELF_WIDTH;
  scene.add(pillar4);

  let HalfWidth = SHELF_HEIGHT / 2 - PILLAR_WIDTH / 2;
  // 边
  const pillar5 = new Mesh(
    new BoxGeometry(SHELF_LENGTH, PILLAR_WIDTH, PILLAR_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar5.position.x = 0;
  pillar5.position.z = 0;
  pillar5.position.y = HalfWidth;
  scene.add(pillar5);

  const pillar6 = new Mesh(
    new BoxGeometry(SHELF_LENGTH, PILLAR_WIDTH, PILLAR_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar6.position.x = 0;
  pillar6.position.z = 0;
  pillar6.position.y = -HalfWidth;
  scene.add(pillar6);

  const pillar7 = new Mesh(
    new BoxGeometry(SHELF_LENGTH, PILLAR_WIDTH, PILLAR_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar7.position.x = 0;
  pillar7.position.z = -SHELF_WIDTH;
  pillar7.position.y = -HalfWidth;
  scene.add(pillar7);

  const pillar8 = new Mesh(
    new BoxGeometry(SHELF_LENGTH, PILLAR_WIDTH, PILLAR_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar8.position.x = 0;
  pillar8.position.z = -SHELF_WIDTH;
  pillar8.position.y = HalfWidth;
  scene.add(pillar8);

  // 横边
  const pillar9 = new Mesh(
    new BoxGeometry(PILLAR_WIDTH, PILLAR_WIDTH, SHELF_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar9.position.x = -SHELF_LENGTH / 2;
  pillar9.position.z = -SHELF_WIDTH / 2;
  pillar9.position.y = HalfWidth;
  scene.add(pillar9);

  const pillar10 = new Mesh(
    new BoxGeometry(PILLAR_WIDTH, PILLAR_WIDTH, SHELF_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar10.position.x = SHELF_LENGTH / 2;
  pillar10.position.z = -SHELF_WIDTH / 2;
  pillar10.position.y = HalfWidth;
  scene.add(pillar10);

  const pillar11 = new Mesh(
    new BoxGeometry(PILLAR_WIDTH, PILLAR_WIDTH, SHELF_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar11.position.x = -SHELF_LENGTH / 2;
  pillar11.position.z = -SHELF_WIDTH / 2;
  pillar11.position.y = -HalfWidth;
  scene.add(pillar11);

  const pillar12 = new Mesh(
    new BoxGeometry(PILLAR_WIDTH, PILLAR_WIDTH, SHELF_WIDTH),
    new MeshLambertMaterial({ color: COLOR })
  );
  pillar12.position.x = SHELF_LENGTH / 2;
  pillar12.position.z = -SHELF_WIDTH / 2;
  pillar12.position.y = -HalfWidth;
  scene.add(pillar12);
}