是否有可能用php运行assimp命令行工具 [英] is it possible to run assimp commandline tool with the php
本文介绍了是否有可能用php运行assimp命令行工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下命令使用assimp Assimp 转换3d模型,并且在Windows上运行良好:
I used following command to convert the 3d models with the assimp Assimp, and it is working fine on Windows:
assimp2json seaknight.obj seaknight.json
我需要知道如何从PHP运行此命令?我知道有一些功能可以从PHP运行外壳程序执行,但是它没有用,也没有出现任何错误.
I need to know how can I run this command from the PHP? I know that there re functions to run the shell execution from PHP, but it didn't work and I don't get any error.
使用的PHP代码如下.
PHP code is used is follows.
system("D:\assimp2json-2.0-win32\Release\assimp2json.exe assimp2json seaknight.obj seaknight.json");
另一个是
$old_path = getcwd();
chdir('D:\assimp2json-2.0-win32\Release');
$output = shell_exec('assimp2json.exe assimp2json seaknight.obj seaknight.json');
chdir($old_path);
推荐答案
我自己找到了
工作代码在下面
$old_path = getcwd();
chdir('D:\assimp2json-2.0-win32\Release');
$output = shell_exec('assimp2json monster.blend monster.json');
chdir($old_path);
无需包含.exe,将其删除后该命令即可生效
no need to include the .exe, after remove it the command worked
这篇关于是否有可能用php运行assimp命令行工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文