Java Code Examples for javax.media.j3d.BranchGroup#compile()

The following examples show how to use javax.media.j3d.BranchGroup#compile() . 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 vote down vote up
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 vote down vote up
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 vote down vote up
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: Main.java    From javagame with MIT License 6 votes vote down vote up
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 5
Source File: Main.java    From javagame with MIT License 6 votes vote down vote up
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 6
Source File: RotatingCube.java    From javagame with MIT License 6 votes vote down vote up
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 7
Source File: MainPanel.java    From javagame with MIT License 6 votes vote down vote up
/**
 * ���E���\�z
 */
private void createSceneGraph() {
    // sceneBG�ɂ��낢��ڑ����邱�ƂŐ��E���\�������
    sceneBG = new BranchGroup();
    // ���E�͈̔́i�����Ȃǂ̋y�Ԕ͈́j
    bounds = new BoundingSphere(new Point3d(0, 0, 0), BOUND_SIZE);

    lightScene(); // ������sceneBG�ɒlj�
    addBackground(); // ���sceneBG�ɒlj�

    // ���W����lj�
    Axis axis = new Axis();
    sceneBG.addChild(axis.getBG());

    sceneBG.compile();
}
 
Example 8
Source File: MainPanel.java    From javagame with MIT License 5 votes vote down vote up
/**
 * ���E���\�z
 */
private void createSceneGraph() {
    // sceneBG�ɂ��낢��ڑ����邱�ƂŐ��E���\�������
    sceneBG = new BranchGroup();
    // ���E�͈̔́i�����Ȃǂ̋y�Ԕ͈́j
    bounds = new BoundingSphere(new Point3d(0, 0, 0), BOUND_SIZE);

    lightScene(); // ������sceneBG�ɒlj�
    addBackground(); // ���sceneBG�ɒlj�
    addSphere(); // ����lj�

    sceneBG.compile();
}
 
Example 9
Source File: MainPanel.java    From javagame with MIT License 5 votes vote down vote up
/**
 * ���E���\�z
 */
private void createSceneGraph() {
    // sceneBG�ɂ��낢��ڑ����邱�ƂŐ��E���\�������
    sceneBG = new BranchGroup();
    // ���E�͈̔́i�����Ȃǂ̋y�Ԕ͈́j
    bounds = new BoundingSphere(new Point3d(0, 0, 0), BOUND_SIZE);

    lightScene(); // ������sceneBG�ɒlj�
    addBackground(); // ���sceneBG�ɒlj�
    
    Floor floor = new Floor();
    sceneBG.addChild(floor.getBG());

    sceneBG.compile();
}