Hello,
I have a skybox, a model and a transparent box. The problem is i can see the model through the box, but not the sky:
Here is my code:
[java]public void simpleInitApp() {
// Ninja
Spatial ninja = assetManager.loadModel(“Models/Ninja/Ninja.mesh.xml”);
ninja.scale(0.05f, 0.05f, 0.05f);
ninja.rotate(0.0f, -3.0f, 0.0f);
ninja.setLocalTranslation(0.0f, -4.0f, -2.0f);
rootNode.attachChild(ninja);
// Box
Box boxshape = new Box(new Vector3f(0f,3f,0f), 2f,2f,2f);
Spatial myBox = new Geometry(“window frame”, boxshape);
Material mat_tt = new Material(assetManager, “Common/MatDefs/Misc/SimpleTextured.j3md”);
mat_tt.setTexture(“m_ColorMap”, assetManager.loadTexture(“Textures/ColoredTex/Monkey.png”));
mat_tt.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
myBox.setMaterial(mat_tt);
rootNode.attachChild(myBox);
// Sky
Spatial skyBox = SkyFactory2.createSky(assetManager, “Textures/Sky/Bright/BrightSky.dds”,false);
// Light
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(sun);
rootNode.attachChild(skyBox);
}[/java]
Thank for your help.
The monkey box has to be in the transparent queue.
[java]
myBox.setQueueBucket(Queue.Transparent);
[/java]
Thanks a lot !