开发者

jMonkeyEngine apply Material inside Mesh?

开发者 https://www.devze.com 2023-04-04 08:37 出处:网络
I\'m using jMonkeyEngine to develop a desktop PC game. It\'s still in early stages (always starting, never finishing, eh?).

I'm using jMonkeyEngine to develop a desktop PC game. It's still in early stages (always starting, never finishing, eh?).

With no physics (just moving the camera), faces disappear when you enter the inside of a Geometry model. So my question is, how do you apply a Material (texture) to the insi开发者_如何学Cde of a mesh?


Have a look at this: material.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);

This should show the texture on both sides. If you need the material only on the inside of your mesh, use FaceCullMode.Front, although in that case you should probably redefine your mesh instead so that its normals are pointing inwards.


Since most meshes don't have an 'inside' you can't do it with the same geometry, a good workaround that worked for me was to use a clone of the mesh but with a negative size though this only works for symmetrical meshes.

0

精彩评论

暂无评论...
验证码 换一张
取 消