将模型从 Maya 8.5 加载到 THREE.JS

发布于 2024-12-18 02:16:13 字数 602 浏览 1 评论 0原文

我在 Maya 8.5 中创建了一个非常简单的模型,以在 THREE.JS 中进行测试,该模型导出为 .obj 并使用来自 THREE.JS github 存储库的 Python 脚本转换为 JSON 文件。

转换看起来工作正常,因为它肯定是一个有效的 JSON 对象,其中包含所有数据。问题是当我加载它时,我收到以下警告:

已弃用:[js/jumper.js] 似乎正在使用旧模型格式

这是否意味着 .obj 格式以某种方式发生了更改,或者我是否缺少其他内容?这是我用来加载对象的代码。我有其他原生形状显示良好,所以我知道设置是正确的,只是这个模型加载我遇到了问题。

loader = new THREE.JSONLoader();
    loader.load("js/jumper.js", function( geometry ) {
        jumper = new Three.Mesh(geometry, new Three.MeshLambertMaterial({ color: 0x88000}));
        jumper.scale.set(10,10,10);
        scene.add(jumper);
        }
    );

I have created a really simple model in Maya 8.5 to test in THREE.JS, the model is exported as .obj and converted to a JSON file using a Python script from the THREE.JS github repo.

The conversion looks like it worked fine as it is certainly a valid JSON object with all the data in there. The problem is when I load it in I get the following warning:

DEPRECATED: [js/jumper.js] seems to be using old model format

Does this mean the .obj format changed somehow or am I missing something else? Here is the code I'm using to load the object. I have other native shapes showing up fine so I know the setup is correct, its just this model loading that I'm having trouble with.

loader = new THREE.JSONLoader();
    loader.load("js/jumper.js", function( geometry ) {
        jumper = new Three.Mesh(geometry, new Three.MeshLambertMaterial({ color: 0x88000}));
        jumper.scale.set(10,10,10);
        scene.add(jumper);
        }
    );

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

生死何惧 2024-12-25 02:16:13

好吧,在 Three.js github 论坛上发帖后,我发现即使在模型加载时运行的处理程序中运行的代码存在问题,您也会收到该错误。因此,即使错误表明模型存在问题,也应在处理程序中检查所有代码。

Ok after posting on three.js github forum, I have found that you will get that error even if there are problems in your code which is run in the handler which is run when the model loads. Therefore all code should be checked in the handler even if the error points to an issue with the model.

攀登最高峰 2024-12-25 02:16:13

我刚刚开始制作一个简单的导出器,用于将 OBJ 转换为 Three.JS 版本 3.1 JSON 格式。因此,如果您只是从 MAYA 导出 OBJ 并使用此处的程序,您也许可以导出。

https://github.com/theMaxscriptGuy/Windows_Programs/tree/master/Obj_To_ThreeJS

谢谢

I have just started to made a simple exporter to convert from OBJ to Three.JS version 3.1 JSON format. So if you just export an OBJ fro MAYA and use the program here, you might be able to export.

https://github.com/theMaxscriptGuy/Windows_Programs/tree/master/Obj_To_ThreeJS

Thanks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文