import javax.media.j3d.*;
import com.sun.j3d.utils.geometry.*;
import javax.vecmath.*;
import com.sun.j3d.utils.universe.SimpleUniverse;
public class Main {
public static void main(String[] args) {
SimpleUniverse univ = new SimpleUniverse ( );
univ.getViewingPlatform( ) .setNominalViewingTransform( );
BranchGroup szene = new BranchGroup ( );
{
Box boden = new Box(1, 0.1f, 1, ColoringAtributes() );
TransformGroup bodenVerschieber = new TransformGroup();
Transform3D verschieben = new Transform3D();
verschieben.setTranslation(new Vector3f(0f,-0.5f,0f));
bodenVerschieber.setTransform(verschieben);
bodenVerschieber.addChild(boden);
szene.addChild(bodenVerschieber);
Color3f farbeBoden = new Color3f (0.392f, 0.392f, 0.392f);
BoundingSphere bounds = new BoundingSphere(new Point3d (0,0,0),10000000);
Vector3f richtungBoden = new Vector3f(5,-6,-10);
DirectionalLight lichtBoden = new DirectionalLight (farbeBoden, richtungBoden);
lichtBoden.setInfluencingBounds (bounds);
szene.addChild(lichtBoden);
}
{
Sphere sonne = new Sphere(0.15f,1,40);
TransformGroup sonnenVerschieber = new TransformGroup();
Transform3D verschieben = new Transform3D();
verschieben.setTranslation(new Vector3f(-0.75f, 0.45f, 0f));
sonnenVerschieber.setTransform(verschieben);
sonnenVerschieber.addChild(sonne);
szene.addChild(sonnenVerschieber);
Color3f farbeSonne = new Color3f (1.0f,1.0f,0);
BoundingSphere bounds = new BoundingSphere(new Point3d (0,0,0), 1000000);
Vector3f richtungSonne = new Vector3f(5,-6,-10);
DirectionalLight lichtSonne = new DirectionalLight (farbeSonne, richtungSonne);
lichtSonne.setInfluencingBounds (bounds);
szene.addChild(lichtSonne);
}
szene.compile();
univ.addBranchGraph(szene);
}
private static Appearance ColoringAtributes() {
return null;
}
}