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.*; public class Kuup3 extends Applet { public Kuup3() { setLayout(new BorderLayout()); Canvas3D c = new Canvas3D(SimpleUniverse.getPreferredConfiguration()); add(c, BorderLayout.CENTER); BranchGroup juur = new BranchGroup(); TransformGroup keere1=new TransformGroup(); keere1.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); RotationInterpolator keeraja1= new RotationInterpolator(new Alpha(-1, 10000), keere1); keeraja1.setSchedulingBounds(new BoundingSphere()); juur.addChild(keere1); keere1.addChild(keeraja1); keere1.addChild(new ColorCube(0.5)); juur.compile(); SimpleUniverse u = new SimpleUniverse(c); u.getViewingPlatform().setNominalViewingTransform(); u.addBranchGraph(juur); } public static void main(String[] args) { Frame f=new Frame("Interpolaatori abil pöörlev kuup"); f.add(new Kuup3()); f.setSize(300, 300); f.setVisible(true); } }