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 Kuup3b extends Applet { public Kuup3b() { setLayout(new BorderLayout()); Canvas3D c = new Canvas3D(SimpleUniverse.getPreferredConfiguration()); add(c, BorderLayout.CENTER); BranchGroup juur = new BranchGroup(); TransformGroup tg1=new TransformGroup(); tg1.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); ScaleInterpolator ip1= new ScaleInterpolator(new Alpha(), tg1); ip1.setSchedulingBounds(new BoundingSphere()); juur.addChild(tg1); tg1.addChild(ip1); tg1.addChild(new ColorCube(0.2)); juur.compile(); SimpleUniverse u = new SimpleUniverse(c); u.getViewingPlatform().setNominalViewingTransform(); u.addBranchGraph(juur); } public static void main(String[] args) { Frame f=new Frame("Suurust muutev kuup"); f.add(new Kuup3b()); f.setSize(300, 300); f.setVisible(true); } }