python - Three.js - 使用 python 导出 obj 文件

标签 python three.js

我想我应该在这里发布这个,因为几个小时的谷歌搜索最终毫无结果。我有一个 obj 文件,我正在尝试使用 Three.js 中包含的 Python 脚本将其导出以在 Three.js 中使用,但是我以前从未使用过 Python,也不知道我在做什么。

到目前为止,这是我的步骤: 我打开了 Python GUI,打开了 convert_obj_third.py,单击 run -> run module,然后我得到了:

======= RESTART: C:\three.js\utils\converters\obj\convert_obj_three.py =======
Usage: convert_obj_three.py -i filename.obj -o filename.js [-m morphfiles*.obj] [-c morphcolors*.obj] [-a center|top|bottom] [-s flat|smooth] [-t binary|ascii] [-d invert|normal]

当我尝试输入诸如 convert_obj_ Three.py -i test.obj -o test.js 之类的内容时,我收到 SyntaxError:无效语法 错误。

test.obj 与 Convert_obj_third.py 位于同一文件夹中,但这似乎不是问题,因为无论我输入什么内容,我似乎都会遇到语法错误...

最佳答案

运行命令:

convert_obj_three.py -i test.obj -o test.js

在命令提示符下。在 Windows 上,Python 必须位于您的路径中才能工作,这是安装程序中的一个选项(至少在 2.7 中),位于选项列表的底部,IME 有时不可见 - 很容易错过 - 所以滚动下来找到它。

关于python - Three.js - 使用 python 导出 obj 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34180995/

相关文章:

python - 如何通过直方图从蒙版图像中提取颜色特征?

three.js - 增加网格上指定的最大变形目标数量

javascript - 在 Three.js 中忽略光源

three.js - 每个实例具有唯一纹理的 InstancedMesh

3d - 将 Unity 转换转换为 THREE.js 旋转

python - Opencv cornerHarris错误

Python Pandas DF 根据列列表创建新变量

Python 3.4,使用 panda 创建 DataFrame 时出错

python - 如何将 numpy 数组与 pandas 系列相乘?

javascript - 在 three.js 中合并几何