|
From: R.T.H.Chin <r.t...@tb...> - 2004-05-25 15:06:33
|
For everybody interested in 3D Animation in DSOL, here is a way to set
the background (color) of the 3D Animation canves:
public class BackGround extends Renderable3D
{
public BackGround(Location staticLocation, SimulatorInterface simulator)
{
super(staticLocation, simulator);
}
protected void provideModel(TransformGroup locationGroup)
{
Color3f bgColor = new Color3f(0.05f, 0.05f, 0.5f);
Background bgNode = new Background(bgColor);
BoundingSphere bounds = new BoundingSphere(new Point3d(0,0,0),
1000.0);
bgNode.setApplicationBounds(bounds);
locationGroup.addChild(bgNode);
}
protected void update(Enumeration children)
{
// Do nothing
}
}
And create it in constructModel:
public void constructModel(SimulatorInterface simulator)
throws SimRuntimeException, RemoteException
{
new BackGround(new Location(0,0,0), simulator);
// OTHER STUFF
}
|