猫史档案馆


全岛第一个变成冰墩墩&雪容容的人!

用户:小鱼队长小鱼队长查看:4 回复:6 评论:4 创建时间:2022-02-15T08:43:15


今天我教大家如何买冰墩墩

az说错了

今天我来教大家如何变成冰墩墩

搜索冰墩墩

找到:

冰墩墩身体&头

冰墩墩 手

冰墩墩 腿 左/右

然后在代码区输入代码:

const bodyData = [
 { bodyPart: Box3BodyPart.TORSO, name: '躯干', mesh: 'mesh/冰墩墩身体&头副本.vb', offset: [0, 0.1, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.LEFT_UPPER_ARM, name: '左上臂', mesh: 'mesh/冰墩墩 手 .vb', offset: [0.1, 0.07,-0.02], rotate: [-128, 120, -85], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.RIGHT_UPPER_ARM, name: '右上臂', mesh: 'mesh/冰墩墩 手 .vb', offset: [-0.1, 0.07,-0.02], rotate: [-45, -120, -85], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.LEFT_UPPER_LEG, name: '左上腿', mesh: 'mesh/冰墩墩 腿 左.vb', offset: [0, -0.05, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.RIGHT_UPPER_LEG, name: '右上腿', mesh: 'mesh/冰墩墩 腿 右.vb', offset: [0, -0.1, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
    ]
    world.onPlayerJoin(({ entity }) => {

        // 隐藏所有身体部件!
        for (const bodyPart in entity.player.skinInvisible) {
            entity.player.skinInvisible[bodyPart] = true;
        }

        // 根据配置穿戴身体各个部件
        for (const data of bodyData) {
            addWearable(entity, data)
        }
    });

    // 添加部件
    function addWearable(entity, data) {
        // 这一步是把角度转成弧度
        const orientation = new Box3Quaternion(0, 0, 0, 1)
                .rotateZ(data.rotate[2] * Math.PI / 180) 
                .rotateX(data.rotate[0] * Math.PI / 180) 
                .rotateY(data.rotate[1] * Math.PI / 180) 
        // 将上面声明的配置一一对应地传递给传递API
        entity.player.addWearable({
            bodyPart: data.bodyPart,
            mesh: data.mesh,
            orientation: orientation,
            scale: data.scale,
            offset: data.offset,
        })
    }

就能变成冰墩墩啦!

 

 

 

有没有人想变成雪容容?

我肯定有办法

搜索雪容容

找到:

雪容容 手

雪容容 腿

雪容容(头)

输入代码:

const bodyData = [
 { bodyPart: Box3BodyPart.HEAD, name: '头', mesh: 'mesh/雪容容(头).vb', offset: [0, 0.4, -0.1], rotate: [0, 450, 0], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.TORSO, name: '躯干', mesh: 'mesh/雪容容身体.vb', offset: [0, 0.1, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.LEFT_UPPER_ARM, name: '左上臂', mesh: 'mesh/雪容容 手 .vb', offset: [0.1, 0.07,-0.02], rotate: [-128, 120, -85], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.RIGHT_UPPER_ARM, name: '右上臂', mesh: 'mesh/雪容容 手 .vb', offset: [-0.1, 0.07,-0.02], rotate: [-45, -120, -85], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.LEFT_UPPER_LEG, name: '左上腿', mesh: 'mesh/雪容容 腿.vb', offset: [0, -0.05, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.RIGHT_UPPER_LEG, name: '右上腿', mesh: 'mesh/雪容容 腿.vb', offset: [0, -0.1, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
    ]
    world.onPlayerJoin(({ entity }) => {

        // 隐藏所有身体部件!
        for (const bodyPart in entity.player.skinInvisible) {
            entity.player.skinInvisible[bodyPart] = true;
        }

        // 根据配置穿戴身体各个部件
        for (const data of bodyData) {
            addWearable(entity, data)
        }
    });

    // 添加部件
    function addWearable(entity, data) {
        // 这一步是把角度转成弧度
        const orientation = new Box3Quaternion(0, 0, 0, 1)
                .rotateZ(data.rotate[2] * Math.PI / 180) 
                .rotateX(data.rotate[0] * Math.PI / 180) 
                .rotateY(data.rotate[1] * Math.PI / 180) 
        // 将上面声明的配置一一对应地传递给传递API
        entity.player.addWearable({
            bodyPart: data.bodyPart,
            mesh: data.mesh,
            orientation: orientation,
            scale: data.scale,
            offset: data.offset,
        })
    }

就变成雪容容啦!


回复

上一页1 页 / 共 1下一页
1086爱编程1086爱编程

沙发

点赞0


评论


望_庐山望_庐山

那叫雪容融吧)

点赞0


评论


小鱼队长小鱼队长

center_image

点赞0


评论


星星上的雪花星星上的雪花

雪容容

点赞0


评论


灵清帝王吃爆一切厕所灵清帝王吃爆一切厕所

((

点赞0


评论


小鱼队长小鱼队长

一个神秘网址(你们进去就行了) https://box3.codemao.cn/e/306c1c40267a43375494

点赞0


评论