is it possible to run assimp commandline tool with the php

丶灬走出姿态 提交于 2020-01-07 05:03:35

问题


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 

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 code is used is follows.

system("D:\assimp2json-2.0-win32\Release\assimp2json.exe assimp2json seaknight.obj seaknight.json");

and another one is

$old_path = getcwd();
chdir('D:\assimp2json-2.0-win32\Release');
$output = shell_exec('assimp2json.exe assimp2json seaknight.obj seaknight.json');
chdir($old_path);

回答1:


Found it myself

working code is below

$old_path = getcwd();
chdir('D:\assimp2json-2.0-win32\Release');
$output = shell_exec('assimp2json monster.blend monster.json');
chdir($old_path);

no need to include the .exe, after remove it the command worked



来源:https://stackoverflow.com/questions/24930225/is-it-possible-to-run-assimp-commandline-tool-with-the-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!