
Lv.1
~( ̄▽ ̄~)~
在 急需招募BOX3代码师和建造师。 中回复
各位,我是本地图拥有者的编程猫社区的小号,我们现在急需知道如何使用云存档的代码师1名和建筑师1~2名,希望大家踊跃参与!
本人非常急!!!
2022-04-05T14:14:06 点赞:0
在 【今天不整活】阿吉向你发出不触屏挑战邀请,来吗? 中回复
我过了imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E5%97%A8%E8%B5%B7%E6%9D%A5.gif"alt="emotion_编程猫_嗨起来"
2022-04-14T09:43:51 点赞:0
在 [作品封面求助] 中回复
2022-11-27T11:27:04 点赞:0
在 怎么把模型变成玩家的皮肤 中回复
// 需要提前把模型放到地图场景里!并且名称与代码中提到的部位名称保持一致,否则会出错
// 其中 offset、rotate 和 scale 分别代表:模型的偏移量、旋转角度和缩放值,需要根据具体的模型去自行调整数值,直接用的话可能导致模型角度不对的情况哦
c喵t 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.TORSO, name: '臀部', mesh: 'mesh/部件教程-臀部.vb', offset: [0, -0.25, 0], rotate: [0, 90, 0], scale: [0.5, 0.7, 0.4] },
{ 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_LOWER_ARM, name: '左下臂', mesh: 'mesh/部件教程-左下臂.vb', offset: [0, 0.11, 0], rotate: [-128, 120, -85], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.RIGHT_LOWER_ARM, name: '右下臂', mesh: 'mesh/部件教程-右下臂.vb', offset: [0, 0.09, 0], 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] },
{ bodyPart: Box3BodyPart.LEFT_LOWER_LEG, name: '左下腿', mesh: 'mesh/部件教程-左下腿.vb', offset: [0, 0.07, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.RIGHT_LOWER_LEG, name: '右下腿', mesh: 'mesh/部件教程-右下腿.vb', offset: [0, 0.07, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.LEFT_FOOT, name: '左脚', mesh: 'mesh/部件教程-左脚.vb', offset: [0, 0.06, 0.05], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.RIGHT_FOOT, name: '右脚', mesh: 'mesh/部件教程-右脚.vb', offset: [0, 0.06, 0.05], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.LEFT_LOWER_ARM, name: '左手', mesh: 'mesh/部件教程-左手.vb', offset: [0.16, 0.16, 0.09], rotate: [-56, -64, 90], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.RIGHT_LOWER_ARM, name: '右手', mesh: 'mesh/部件教程-右手.vb', offset: [-0.16, 0.05, 0.1], rotate: [-138, 60, 95], scale: [0.5, 0.5, 0.5] },
]
world.onPlayerJoin(({ entity }) => {
// 隐藏所有身体部件!
for (c喵t bodyPart in entity.player.skinInvisible) {
entity.player.skinInvisible[bodyPart] = true;
}
// 根据配置穿戴身体各个部件
for (c喵t data of bodyData) {
addWearable(entity, data)
}
});
// 添加部件
function addWearable(entity, data) {
// 这一步是把角度转成弧度
c喵t 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,
})
}2022-12-17T15:54:32 点赞:0