Invert Box for texture inside box (for space)

Hello,



i need to invert box to make texture appears inside him.

Camera also will be placed into box.

Apply a material on the box and change faceCullMode of the material like this

[java]

Material m=assetManager.loadMaterial("your material");

m.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Front);

[/java]

Only back faces will be drawn at render so the cube will be visible from its inside.

if you want it to be visible from the inside and from the outside, use the FaceCullMode.Off.



However if you are using the Lighting.j3md material definition you will have to invert the normals of the cube so they go through the inside.

Hello, I’m facing kind of the same problem, I have blender made dome with a texture for the sky, but when I import the .obj in jmonkey, the texture appears yellow collored when seen from inside. I saw your code nehon, and I just didnt get the assetManager part, what object is this? 1 more question, can I load a .mtl to be the material?



Thanks

the assetManager is what allow you to load assets. I suggest you read the tutorials https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_asset



you have an instance of the assetManager in simpleApplication.



the loadMaterial method load j3m as far as i know, i don’t think it can load anything else. But you can try

However, there must be a way to read mtl, because .obj importer loads mtl files too i think.

Hmm, but I have a problem, because I’m using jme2 in my project, and I’m using the SimpleApplet class (it has all the features from SimpleGame, but for applets) and this ‘assetManager’ doens’t exists there :confused:



Is there any suggestion on how can I create my own assetManager? (in jme2)

Oh ok…i’m sorry i assumed you were using JME3.

I’m afraid i won’t be able to help you on this one i’m not familiar with JME2.

is there any big diferences between the jme2 and jme3 code? maybe I could just migrate to jme3 and solve my problems :slight_smile:

Read the first page of the wiki and you’ll find the answer to that question by the time you reach the third paragraph:

https://wiki.jmonkeyengine.org/legacy/doku.php



If you’re okay with supporting only OpenGL 2 and above, use jME3. There are big code differences though, so be prepared to do a lot of rewriting.

hmm, ok…