Search code examples
java3djmonkeyengine

jMonkeyEngine apply Material inside Mesh?


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 inside of a mesh?


Solution

  • 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.