import java.applet.Applet; import java.awt.*; import com.sun.j3d.utils.geometry.*; import com.sun.j3d.utils.universe.SimpleUniverse; import javax.media.j3d.*; public class Valgus1 extends Applet { public Valgus1() { setLayout(new BorderLayout()); Canvas3D c = new Canvas3D(SimpleUniverse.getPreferredConfiguration()); add(c, BorderLayout.CENTER); BranchGroup juur = new BranchGroup(); Appearance a=new Appearance(); a.setMaterial(new Material()); juur.addChild(new Sphere(0.5f, Sphere.GENERATE_NORMALS, a)); AmbientLight taustavalgus=new AmbientLight(); taustavalgus.setInfluencingBounds(new BoundingSphere()); juur.addChild(taustavalgus); SimpleUniverse u = new SimpleUniverse(c); u.getViewingPlatform().setNominalViewingTransform(); u.addBranchGraph(juur); } public static void main(String[] args) { Frame f=new Frame("Kuup"); f.add(new Valgus1()); f.setSize(300, 300); f.setVisible(true); } }