アットウィキロゴ

JAVA53

import javax.media.j3d.*;
import com.sun.j3d.utils.universe.*;
import java.awt.*;
import javax.swing.*;
import com.sun.j3d.utils.geometry.*;
public class ex53
{
public static void main(String[] args)
{
  ex53 test = new ex53();
}
public ex53()
{
  JFrame frame = new JFrame();
  frame.setSize(800,800);
  frame.setTitle("ex53");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  JPanel cp = new JPanel();
  cp.setLayout(null);
  frame.add(cp);
  GraphicsConfiguration g_config = SimpleUniverse.getPreferredConfiguration();
  Canvas3D canvas = new Canvas3D(g_config);
  canvas.setBounds(100,100,500,500);
  cp.add(canvas);
  SimpleUniverse universe = new SimpleUniverse(canvas);
  frame.setVisible(true);
  BranchGroup group1 = new BranchGroup();
  Sphere sphere = new Sphere(0.5f);
  group1.addChild(sphere);
  universe.addBranchGraph(group1);
  ViewingPlatform camera = universe.getViewingPlatform();
  camera.setNominalViewingTransform();
}
}
最終更新:2010年01月06日 15:11