three.js创建简单的3D机房(1) 创建机柜模型-1

import * as THREE from "three"

const defultCabinetObj ={
    w:60, //宽
    h:200,//高
    z:60,//深
    layers:42,//层数
}

const basicParameters ={
    thickness:5, // 竖板厚度
}

class cabinet {

constructor(options){

this.options= options;

// 房间场景

this.scene = options.scene;

this.camera = options.camera;

// 机柜各个面相对于0,0,0的坐标 坐标参数 x y z

this.position = {x:0,y:0,z:0};

// 机柜位置及旋转参数

this.cabPosition =options.cabPosition || {x:0,y:0,z:0,rotatex:0,rotatey:0,rotatez:0}

// 机柜参数

this.cabinetObj = options.cabinetObj || defultCabinetObj;

// 机柜编号

this.cabId = options.cabId;

 

// 机柜状态

this.status = options.status || 0;

// 剩余槽位

this.cabSlot = options.slot || 42;

//优化 从外部创建一次传入 不重复创建

this.cabinetbgMateria

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值