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 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.
精彩评论