webgl three 项目常用操作

分组
    const group1 = new THREE.Group(); //所有高层楼的父对象
    group1.name = "高层";
    for (let i = 0; i < 5; i++) {
        const geometry = new THREE.BoxGeometry(20, 60, 10);
        const material = new THREE.MeshLambertMaterial({
            color: 0x00ffff
        });
        const mesh = new THREE.Mesh(geometry, material0);
        mesh.position.x = i * 30; // 网格模型mesh沿着x轴方向阵列
        group1.add(mesh); //添加到组对象group1
        mesh.name = i + 1 + '号楼';
        // console.log('mesh.name',mesh.name);
    }
    group1.position.y = 30;
    const group2 = new THREE.Group();
    group2.name = "洋房";
    // 批量创建多个长方体表示洋房
    for (let i = 0; i < 5; i++) {
        const geometry = new THREE.BoxGeometry(20, 30, 10);
        const material = new THREE.MeshLambertMaterial({
            color: 0x00ffff
        });
        const mesh = new 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值