com.sun.j3d.utils.universe.SimpleUniverse Java Examples
The following examples show how to use
com.sun.j3d.utils.universe.SimpleUniverse.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CrystalBall.java From javagame with MIT License | 7 votes |
public CrystalBall() { setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse .getPreferredConfiguration(); Canvas3D canvas = new Canvas3D(config); add(canvas, BorderLayout.CENTER); universe = new SimpleUniverse(canvas); // �V�[�����\�z BranchGroup scene = createSceneGraph(); scene.compile(); // ���_���Z�b�g universe.getViewingPlatform().setNominalViewingTransform(); // �}�E�X���� orbitControls(canvas); universe.addBranchGraph(scene); }
Example #2
Source File: Main3D.java From javagame with MIT License | 6 votes |
public Main3D() { setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse .getPreferredConfiguration(); Canvas3D canvas = new Canvas3D(config); add(canvas, BorderLayout.CENTER); universe = new SimpleUniverse(canvas); // �V�[�����\�z BranchGroup scene = createSceneGraph(); scene.compile(); // ���_���Z�b�g universe.getViewingPlatform().setNominalViewingTransform(); // �}�E�X���� orbitControls(canvas); universe.addBranchGraph(scene); }
Example #3
Source File: Main3D.java From javagame with MIT License | 6 votes |
public Main3D() { setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse .getPreferredConfiguration(); Canvas3D canvas = new Canvas3D(config); add(canvas, BorderLayout.CENTER); universe = new SimpleUniverse(canvas); // �V�[�����\�z BranchGroup scene = createSceneGraph(); scene.compile(); // ���_���Z�b�g universe.getViewingPlatform().setNominalViewingTransform(); // �}�E�X���� orbitControls(canvas); universe.addBranchGraph(scene); }
Example #4
Source File: MainPanel.java From javagame with MIT License | 6 votes |
public MainPanel() { setPreferredSize(new Dimension(WIDTH, HEIGHT)); setLayout(new BorderLayout()); // 3D���f����`�悷��L�����p�X���쐬 GraphicsConfiguration config = SimpleUniverse .getPreferredConfiguration(); Canvas3D canvas3D = new Canvas3D(config); add(canvas3D, BorderLayout.CENTER); canvas3D.setFocusable(true); canvas3D.requestFocus(); // ���E���쐬 universe = new SimpleUniverse(canvas3D); createSceneGraph(); // ���E�i�V�[���O���t�j���\�z initUserPosition(); // ���[�U�̎��_�������� orbitControls(canvas3D); // �}�E�X���� universe.addBranchGraph(sceneBG); }
Example #5
Source File: Main.java From javagame with MIT License | 6 votes |
public Main() { setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse .getPreferredConfiguration(); Canvas3D canvas = new Canvas3D(config); add(canvas, BorderLayout.CENTER); universe = new SimpleUniverse(canvas); // �V�[�����\�z BranchGroup scene = createSceneGraph(); scene.compile(); // ���_���Z�b�g universe.getViewingPlatform().setNominalViewingTransform(); // �}�E�X���� orbitControls(canvas); universe.addBranchGraph(scene); }
Example #6
Source File: MainPanel.java From javagame with MIT License | 6 votes |
public MainPanel() { setPreferredSize(new Dimension(WIDTH, HEIGHT)); setLayout(new BorderLayout()); // 3D���f����`�悷��L�����p�X���쐬 GraphicsConfiguration config = SimpleUniverse .getPreferredConfiguration(); Canvas3D canvas3D = new Canvas3D(config); add(canvas3D, BorderLayout.CENTER); canvas3D.setFocusable(true); canvas3D.requestFocus(); // ���E���쐬 universe = new SimpleUniverse(canvas3D); createSceneGraph(); // ���E�i�V�[���O���t�j���\�z initUserPosition(); // ���[�U�̎��_�������� orbitControls(canvas3D); // �}�E�X���� universe.addBranchGraph(sceneBG); }
Example #7
Source File: Main.java From javagame with MIT License | 6 votes |
public Main() { setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse .getPreferredConfiguration(); Canvas3D canvas = new Canvas3D(config); add(canvas, BorderLayout.CENTER); universe = new SimpleUniverse(canvas); // �V�[�����\�z BranchGroup scene = createSceneGraph(); scene.compile(); // ���_���Z�b�g Transform3D viewPlatformTransform = new Transform3D(); viewPlatformTransform.setTranslation(new Vector3d(0.0, 0.0, 10.0)); universe.getViewingPlatform().getViewPlatformTransform().setTransform(viewPlatformTransform); // �}�E�X���� orbitControls(canvas); universe.addBranchGraph(scene); }
Example #8
Source File: RotatingCube.java From javagame with MIT License | 6 votes |
public RotatingCube() { setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration(); Canvas3D canvas = new Canvas3D(config); add(canvas, BorderLayout.CENTER); SimpleUniverse universe = new SimpleUniverse(canvas); // �V�[�����\�z BranchGroup scene = createSceneGraph(); scene.compile(); // ���_���Z�b�g universe.getViewingPlatform().setNominalViewingTransform(); universe.addBranchGraph(scene); }
Example #9
Source File: MainPanel.java From javagame with MIT License | 6 votes |
public MainPanel() { setPreferredSize(new Dimension(WIDTH, HEIGHT)); setLayout(new BorderLayout()); // 3D���f����`�悷��L�����p�X���쐬 GraphicsConfiguration config = SimpleUniverse .getPreferredConfiguration(); Canvas3D canvas3D = new Canvas3D(config); add(canvas3D, BorderLayout.CENTER); canvas3D.setFocusable(true); canvas3D.requestFocus(); // ���E���쐬 universe = new SimpleUniverse(canvas3D); createSceneGraph(); // ���E�i�V�[���O���t�j���\�z initUserPosition(); // ���[�U�̎��_�������� orbitControls(canvas3D); // �}�E�X���� universe.addBranchGraph(sceneBG); }
Example #10
Source File: Visualizer3D.java From jMAVSim with BSD 3-Clause "New" or "Revised" License | 5 votes |
public Visualizer3D(World world) { this.world = world; setSize(640, 480); setDefaultCloseOperation(EXIT_ON_CLOSE); GraphicsConfiguration gc = SimpleUniverse.getPreferredConfiguration(); Canvas3D canvas = new Canvas3D(gc); getContentPane().add(canvas); universe = new SimpleUniverse(canvas); universe.getViewer().getView().setBackClipDistance(100000.0); viewerTransformGroup = universe.getViewingPlatform().getViewPlatformTransform(); createEnvironment(); for (WorldObject object : world.getObjects()) { if (object instanceof KinematicObject) { BranchGroup bg = ((KinematicObject) object).getBranchGroup(); if (bg != null) { universe.addBranchGraph(bg); } } } setVisible(true); Matrix3d mat = new Matrix3d(); Matrix3d mat1 = new Matrix3d(); mat.rotZ(Math.PI); mat1.rotY(Math.PI / 2); mat.mul(mat1); mat1.rotZ(-Math.PI / 2); mat.mul(mat1); viewerTransform.setRotation(mat); }