猫史档案馆


AbnormalLOG

AbnormalLOG

Lv.1

我是屑

获赞:27收藏:3浏览:308作品收藏:2

签名:小号__eq__, 大号__name__kP81.

回复帖子评论
上一页5 页 / 共 12下一页

【岛3 🎃万圣鬼马创作节!】送限量狼人皮肤 中回复

皮肤什么时候发放emotion_编程猫_翻白眼

2020-11-01T09:47:31 点赞:0

国庆地图延期! 中回复

链接可以发过来吗

2020-11-01T11:22:40 点赞:0

【OMG】惊人的BOX BUG!!? 中回复

center_image

绿色的南瓜灯

center_image

红色的古风灯

2020-11-01T18:46:33 点赞:0

【岛3 🎃万圣鬼马创作节!】送限量狼人皮肤 中回复

center_image

狼人皮肤

2020-11-03T17:28:28 点赞:0

玩编程猫的都是多大年龄啊? 中回复

.   

2020-11-05T20:46:13 点赞:0

玩编程猫的都是多大年龄啊? 中回复

在bcm已经1年半了emotion_doge

2020-11-05T20:56:27 点赞:0

玩编程猫的都是多大年龄啊? 中回复

11

2020-11-06T18:32:05 点赞:0

【岛3-API教程3!】用方块检测,做一片刀山火海🌋 中回复

center_image

看~

代码:

function cylinder(cx,cy,cz,vox,radius,height){
  var xend = cx+radius
  var yend = cy+height
  var zend = cz+radius
  for(var x=cx-radius;x<=xend;x++){
    for(var z=cz-radius;z<=zend;z++){
      var dx = x-cx;
      var dz = z-cz;



      if(Math.round(Math.sqrt(dx*dx+dz*dz))<=radius){
        for(var y=cy;y<yend;y++){
          voxels.setVoxel(x,y,z,vox)
        }
      }
    }
  }
}

for (var i = 0; i < 300; i++) { // 300个随机圆柱体构成场景
    let x = Math.random() * 125 // x坐标
    let y = 9 + Math.random() * 20 //y坐标
    let z = Math.random() * 125 // z坐标
    let h = Math.random() * 4 // 高 0~4
    let r = 2 + Math.random() * 5 //半径 2~7
    cylinder(x, y, z, 'stone', r, h)
}

for(var y=9;y<125;y++){//扫描9~12层的格子
  for(var x=0;x<127;x++){
    for(var z=0;z<127;z++){
      // 如果当前格子不为空而它上面那格是空的, 则表示它是复杂地形的表面 
      if(voxels.getVoxel(x,y,z)!=0 && voxels.getVoxel(x,y+1,z)==0){
        voxels.setVoxel(x,y,z,'grass')
                var rnd = Math.random()
        var cx = x+0.5 // 修正到方块中心的x坐标
        var cz = z+0.5 // 修正到方块中心的z坐标
        if(rnd<0.01){

            const ng= spawn(cx,y+1,cz,'mesh/小南瓜2.vb',1)
            ng.meshEmissive=0.1
            ng.meshColor=new Box3RGBAColor(1,1,0,1)
            ng.a喵Tag('南瓜')
        }
        else if (rnd<0.02) {

            spawn(cx,y+1,cz,'mesh/枯树1.vb',0.8)
        } else if (rnd<0.03) {
            spawn(cx,y+1,cz,'mesh/尖刺栏杆1.vb',0.8)
        } else if (rnd<0.04) {
            voxels.setVoxel(cx,y+1,cz,voxels.id('yellow_light'))
        } else if (rnd<0.05) {
            
        }

        


      }
    }
  }
}

async function correctY(entity){
  await sleep(1)//entity.bounds需要等到下一个tick才会变成真正的值
  entity.position.y += entity.bounds.y//bounds.y是中心点到模型顶部或底部的距离
}

function spawn(x,y,z,meshName,scale){
  const meshScale = scale/16 //默认模型方块大小倍数为地图方块的1/16
  const entity = world.createEntity({
    mesh:meshName,//模型名
    collides:false,//不能碰撞
    fixed:true,//固定
    gravity:false,// 不受重力影响
    meshScale:[meshScale,meshScale,meshScale],//xyz放大倍数
    position:[x,y,z],//位置坐标
  })
  if (meshName==='mesh/小南瓜2.vb') {
      voxels.setVoxel(x,y-1,z,voxels.id('yellow_light'))
  }
  correctY(entity)
  return entity
}

链接:https://box3create.codemao.cn/games/18ca953836983d8f1fed

2020-11-07T09:05:36 点赞:0

box3的bug!模型搜索失败 中回复

我也一样!!!!!!

2020-11-07T09:50:53 点赞:1

box3的bug!模型搜索失败 中回复

ddcenter_image

2020-11-07T09:54:01 点赞:0

box3的bug!模型搜索失败 中回复

已经好啦~

2020-11-07T19:59:05 点赞:0

我觉得这就很喵 中回复

小明和小红在校门口 分 手

2020-11-07T20:36:11 点赞:0

doge.... 中回复

center_image

emotion_雷电猴_摇椅子

2020-11-14T08:06:18 点赞:1

doge.... 中回复

center_image

2020-11-14T09:38:30 点赞:0

box3最脏垃圾场! 中回复

呕……center_image

2020-11-14T12:19:54 点赞:1

box3 WebGL Error如何解决 中回复

center_image

2020-11-15T11:23:43 点赞:0

555吉吉喵你来看一下啊 中回复

ddd

2020-11-15T11:28:47 点赞:0

教你怎么做彩虹字 中回复

<font color="#FF0000"></font><font color="#7F0080

2020-11-20T17:28:34 点赞:0

教你怎么做彩虹字 中回复


H T M L

2020-11-20T17:29:44 点赞:0

彩虹字az 中回复

HTML

2020-11-21T07:06:17 点赞:0

教你怎么做彩虹字 中回复


H T M L

2020-11-22T13:51:52 点赞:0

你们都几岁了? 中回复

11

2020-11-22T15:20:18 点赞:0

发现一个bug 中回复

很正常啊emotion_编程猫_翻白眼

2020-11-28T17:59:17 点赞:0

【半成品】文档整理器-无素材版 中回复

2020-11-29T22:07:05 点赞:0

【岛3圣诞更新🎄】创作节赢新皮肤,传送门API连通多个地图! 中回复

https://box3.codemao.cn/e/dfb6f14772bb7b929748

有人来帮忙吗?

2020-12-05T10:17:12 点赞:0

【岛3圣诞更新🎄】创作节赢新皮肤,传送门API连通多个地图! 中回复

大家发现了吗编程猫社区的论坛发不了帖了emotion_dogecenter_image

2020-12-05T18:37:47 点赞:0

【岛3圣诞创作节】圣诞公园【】 中回复

链接:https://box3.codemao.cn/e/dfb6f1477喵b7b929748

2020-12-06T11:34:02 点赞:0

【岛3圣诞更新🎄】创作节赢新皮肤,传送门API连通多个地图! 中回复

https://shequ.codemao.cn/community/352475

2020-12-08T18:08:10 点赞:0

【🎄岛3大新闻】圣诞世界树即将诞生!哈农上空出现神秘身影…… 中回复

·地图名字:圣诞公园【】

·游玩链接:https://box3.codemao.cn/p/79861c4b5f7ef0da8f7b

·作品截图:

2020-12-10T18:20:10 点赞:1

【代码岛3.0实体AI研究室】如何让实体来回旋转? 中回复

2020-12-12T11:46:01 点赞:0