import java.applet.Applet; import java.awt.*; import com.sun.j3d.utils.geometry.ColorCube; import com.sun.j3d.utils.universe.SimpleUniverse; import javax.media.j3d.*; import javax.vecmath.*; public class Taust1 extends Applet { public Taust1() { setLayout(new BorderLayout()); Canvas3D c = new Canvas3D(SimpleUniverse.getPreferredConfiguration()); add(c, BorderLayout.CENTER); BranchGroup juur = new BranchGroup(); juur.addChild(new ColorCube(0.5)); Background taust=new Background(new Color3f(Color.yellow)); //kollane taust taust.setApplicationBounds(new BoundingSphere(new Point3d(), 1000)); juur.addChild(taust); juur.compile(); SimpleUniverse u = new SimpleUniverse(c); u.getViewingPlatform().setNominalViewingTransform(); u.addBranchGraph(juur); } public static void main(String[] args) { Frame f=new Frame("Taustaga kuup"); f.add(new Taust1()); f.setSize(300, 300); f.setVisible(true); } }