final TextureState ts = new TextureState();
ts.setEnabled(true);
ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", MinificationFilter.Trilinear, true));
opaques.setRenderState(ts);
final LightState ls = new LightState();
ls.setEnabled(true);
final DirectionalLight dLight = new DirectionalLight();
dLight.setEnabled(true);
dLight.setDiffuse(new ColorRGBA(1, 1, 1, 1));
dLight.setDirection(new Vector3(1, 1, 1));
ls.attach(dLight);
final DirectionalLight dLight2 = new DirectionalLight();
dLight2.setEnabled(true);
dLight2.setDiffuse(new ColorRGBA(1, 1, 1, 1));
dLight2.setDirection(new Vector3(-1, -1, -1));
ls.attach(dLight2);
ls.setTwoSidedLighting(false);
transps.setRenderState(ls);
transps.getSceneHints().setLightCombineMode(LightCombineMode.Replace);
final Box tb1 = new Box("TBox Blue", min, max);
tb1.setModelBound(new BoundingBox());
tb1.setTranslation(new Vector3(0, 15, 15));
transps.attachChild(tb1);
final MaterialState ms1 = new MaterialState();
ms1.setEnabled(true);
ms1.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(0, 0, 1, .75f));
ms1.setShininess(MaterialFace.FrontAndBack, 128);
tb1.setRenderState(ms1);
final Torus tb2 = new Torus("TBox Green", 20, 20, 3, 6);
tb2.setModelBound(new BoundingBox());
tb2.setTranslation(new Vector3(0, 0, 30));
transps.attachChild(tb2);
final MaterialState ms2 = new MaterialState();
ms2.setEnabled(true);
ms2.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(0, 1, 0, .5f));
ms2.setShininess(MaterialFace.FrontAndBack, 128);
tb2.setRenderState(ms2);
final Box tb3 = new Box("TBox Red", min, max);
tb3.setModelBound(new BoundingBox());
tb3.setTranslation(new Vector3(0, 0, 15));
transps.attachChild(tb3);
final MaterialState ms3 = new MaterialState();
ms3.setEnabled(true);
ms3.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(1, 0, 0, .5f));
ms3.setShininess(MaterialFace.FrontAndBack, 128);
tb3.setRenderState(ms3);
final BlendState as = new BlendState();
as.setEnabled(true);
as.setBlendEnabled(true);
as.setSourceFunction(SourceFunction.SourceAlpha);
as.setDestinationFunction(DestinationFunction.OneMinusSourceAlpha);
transps.setRenderState(as);
final Vector2 center = new Vector2(_canvas.getCanvasRenderer().getCamera().getWidth() >> 1, _canvas
.getCanvasRenderer().getCamera().getWidth() >> 1);
final Quad q1 = new Quad("Ortho Q1", 40, 40);
q1.setTranslation(new Vector3(100 + center.getX(), 100 + center.getY(), 0));
q1.getSceneHints().setOrthoOrder(1);
q1.setDefaultColor(ColorRGBA.WHITE);
q1.getSceneHints().setLightCombineMode(LightCombineMode.Off);
orthos.attachChild(q1);
final Quad q2 = new Quad("Ortho Q2", 100, 100);
q2.setTranslation(new Vector3(60 + center.getX(), 60 + center.getY(), 0));
q2.getSceneHints().setOrthoOrder(5);
q2.setDefaultColor(ColorRGBA.RED);
q2.getSceneHints().setLightCombineMode(LightCombineMode.Off);
orthos.attachChild(q2);
final Quad q3 = new Quad("Ortho Q3", 120, 60);
q3.setTranslation(new Vector3(-20 + center.getX(), -150 + center.getY(), 0));
q3.getSceneHints().setOrthoOrder(2);
q3.setDefaultColor(ColorRGBA.BLUE);
q3.getSceneHints().setLightCombineMode(LightCombineMode.Off);
orthos.attachChild(q3);
final ZBufferState zstate = new ZBufferState();
zstate.setWritable(false);
zstate.setEnabled(false);
orthos.setRenderState(zstate);
orthos.setRenderState(new LightState());
_root.getSceneHints().setCullHint(CullHint.Always);
opaques.getSceneHints().setCullHint(CullHint.Dynamic);
transps.getSceneHints().setCullHint(CullHint.Dynamic);
orthos.getSceneHints().setCullHint(CullHint.Never);