protected void initExample() {
UIComponent.setUseTransparency(true);
// Add a spinning 3D box to show behind UI.
final Box box = new Box("Box", new Vector3(0, 0, 0), 5, 5, 5);
box.setModelBound(new BoundingBox());
box.setTranslation(new Vector3(0, 0, -15));
box.addController(new SpatialController<Box>() {
private final Matrix3 rotate = new Matrix3();
private double angle = 0;
private final Vector3 axis = new Vector3(1, 1, 0.5f).normalizeLocal();
public void update(final double time, final Box caller) {
angle += time * 50;
angle %= 360;
rotate.fromAngleNormalAxis(angle * MathUtils.DEG_TO_RAD, axis);
caller.setRotation(rotate);
}
});
// Add a texture to the box.
final TextureState ts = new TextureState();
final Texture tex = TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear,
true);
ts.setTexture(tex);
box.setRenderState(ts);
//_root.attachChild(box);
final UIPanel panel = makeWidgetPanel();
final UIPanel panel2 = makeLoginPanel();