import java.applet.Applet; import java.awt.*; import com.sun.j3d.utils.geometry.ColorCube; import com.sun.j3d.utils.universe.SimpleUniverse; import com.sun.j3d.utils.behaviors.keyboard.*; import javax.media.j3d.*; import javax.vecmath.*; public class Asukoht1 extends Applet { public Asukoht1() { setLayout(new BorderLayout()); Canvas3D c = new Canvas3D(SimpleUniverse.getPreferredConfiguration()); add(c, BorderLayout.CENTER); BranchGroup juur = new BranchGroup(); juur.addChild(new ColorCube(0.5)); SimpleUniverse u = new SimpleUniverse(c); Transform3D t=new Transform3D(); t.setTranslation(new Vector3f(0, 0.6f, 3)); u.getViewingPlatform().getViewPlatformTransform().setTransform(t); u.addBranchGraph(juur); } public static void main(String[] args) { Frame f=new Frame("Vaatepaiga asukoht"); f.add(new Asukoht1()); f.setSize(300, 300); f.setVisible(true); } }