* @return the node containing the objects
*/
private Node createObjects() {
final Node objects = new Node("objects");
final Torus torus = new Torus("Torus", 50, 50, 8, 17);
torus.setTranslation(new Vector3(50, -5, 20));
TextureState ts = new TextureState();
torus.addController(new SpatialController<Torus>() {
private double timer = 0;
private final Matrix3 rotation = new Matrix3();
public void update(final double time, final Torus caller) {
timer += time * 0.5;
caller.setTranslation(Math.sin(timer) * 40.0, Math.sin(timer) * 40.0, Math.cos(timer) * 40.0);
rotation.fromAngles(timer * 0.5, timer * 0.5, timer * 0.5);
caller.setRotation(rotation);
}
});
Texture t0 = TextureManager.load("images/ardor3d_white_256.jpg",
Texture.MinificationFilter.BilinearNearestMipMap, true);
ts.setTexture(t0, 0);
ts.setEnabled(true);
torus.setRenderState(ts);
objects.attachChild(torus);
ts = new TextureState();
t0 = TextureManager
.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.BilinearNearestMipMap, true);