【发布时间】:2015-08-22 17:16:17
【问题描述】:
所以 Minecraft 使用程序网格,它们如何处理特定的块?他们如何将石块和泥块分开?
我的世界只是一个例子。我想知道它在技术上是如何工作的。
【问题讨论】:
-
这不是我想知道的。
标签: minecraft mesh procedural
所以 Minecraft 使用程序网格,它们如何处理特定的块?他们如何将石块和泥块分开?
我的世界只是一个例子。我想知道它在技术上是如何工作的。
【问题讨论】:
标签: minecraft mesh procedural
如果您谈论的是块模型,例如纹理是如何分层的,Minecraft 使用 .json 文件作为最新 Minecraft 版本 1.8 的模型。 .json文件的一个例子如下:
{
"ambientocclusion": false,
"textures": {
"particle": "blocks/glass",
"glass": "blocks/glass",
"obsidian": "blocks/obsidian",
"beacon": "blocks/beacon"
},
"elements": [
{ "__comment": "Glass shell",
"from": [ 0, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass" }
}
},
{ "__comment": "Obsidian base",
"from": [ 2, 0.1, 2 ],
"to": [ 14, 3, 14 ],
"faces": {
"down": { "uv": [ 2, 2, 14, 14 ], "texture": "#obsidian" },
"up": { "uv": [ 2, 2, 14, 14 ], "texture": "#obsidian" },
"north": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" },
"south": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" },
"west": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" },
"east": { "uv": [ 2, 13, 14, 16 ], "texture": "#obsidian" }
}
},
{ "__comment": "Inner beacon texture",
"from": [ 3, 3, 3 ],
"to": [ 13, 14, 13 ],
"faces": {
"down": { "uv": [ 3, 3, 13, 13 ], "texture": "#beacon" },
"up": { "uv": [ 3, 3, 13, 13 ], "texture": "#beacon" },
"north": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" },
"south": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" },
"west": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" },
"east": { "uv": [ 3, 2, 13, 13 ], "texture": "#beacon" }
}
}
]
}
所有方块模型都是在这样的文件中制作的,玩家可以修改这些文件。然后游戏进入并读取它们,从.json 数据创建模型。有several 3rd party programs that assist in making of these files.
如果您有兴趣了解如何读取 .json 文件,那么反编译 Minecraft 的一个很好的程序是 Minecraft Coder Pack,另一个 3rd 方程序。
【讨论】:
好吧,如果你想看看 Minecraft 如何区分石块和泥块,例如,他们会这样做:
.json 文件用于配置方块的外观,如下所示:{
"parent": "block/cube_all",
"textures": {
"all": "blocks/dirt"
}
}
Minecraft 还有blockstate.json 文件,用于定义方块的变体,例如树苗的生长状态。
【讨论】: