本文介绍了在 jmonkeyengine 中为 OGre 3D 模型启用材质和纹理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 WorldForge 下载了模型,我可以将地精的网格引入我的场景,但纹理和材质不会渲染:

I downloaded models from WorldForge and I can introduce the mesh of a goblin to my scene but the texture and material won't render:

我使用 eclipse 并且添加的文件如下所示:

I use eclipse and the added files look like this:

我在代码中添加妖精的方式是这样的

The way I add the goblin in the code is this

Spatial model3 = assetManager.loadModel("objects/creatures/goblin/goblin.mesh.xml");
model3.setLocalTranslation(-30.0f, 4.5f, 0.0f);
rootNode.attachChild(model3);

你能帮我改进地精吗?文件中有几个纹理和材料定义,但我的场景似乎只加载了 goblin.mesh.xml.

Can you help me how I improve the goblin? There are several textures and materials definition in the files but it seems like only the goblin.mesh.xml is loaded by my scene.

非常感谢任何帮助.

推荐答案

我不确定这是否会有所帮助,但请看这里:http://jmonkeyengine.org/wiki/doku.php/jme3:external:blender,尤其是在将士兵添加到场景中的代码示例中.

I am not sure if this will help, but take a look here: http://jmonkeyengine.org/wiki/doku.php/jme3:external:blender, especially at the code sample where soldier is being added to scene.

我认为您必须在代码中明确声明材料,然后将其附加到代表您的妖精的空间.到目前为止,您只导入了网格,在我看来,您还必须以某种方式导入材质.

I think you have to explicitly declare material in your code, and then attach it to the Spatial representing your goblin. So far you imported only mesh, it seems to me you also have to import material somehow.

这篇关于在 jmonkeyengine 中为 OGre 3D 模型启用材质和纹理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 16:23