我找到了一个将 m3 文件(星际争霸 2 中使用的 3D 模型)转换为 obj 文件的脚本,但我不知道如何使用它。我得到的所有信息都是“嗯,这是脚本。”,所以除了我以前从未听说过 PHP 的事实之外,我不能真正给你太多信息。
这是脚本
<?php
#########################
# $argv[1] can be edited to any custom path
#########################
$temp = explode(".m3", $argv[1]);
$file = $argv[1];
$path = $temp[0];# "./Assets/Doodads/AiurTree/AiurTree_06";
echo("Exporting Model $path to $path.obj\n\n");
$file = fopen($file, 'rb') or die("Failed to open $file!\n");
if(fread($file,4) != "33DM") die("Failed! File is not a StarCraft 2 model!\n");
fseek($file, 4); # find where tags start
$index = unpack(V, fread($file, 4));
# search for __8U "5F 5F 38 55" …Run Code Online (Sandbox Code Playgroud)