Example usage for javax.media.j3d VirtualUniverse VirtualUniverse

List of usage examples for javax.media.j3d VirtualUniverse VirtualUniverse

Introduction

In this page you can find the example usage for javax.media.j3d VirtualUniverse VirtualUniverse.

Prototype

public VirtualUniverse() 

Source Link

Document

Constructs a new VirtualUniverse.

Usage

From source file:QueryProperties.java

public static void main(String[] args) {
    VirtualUniverse vu = new VirtualUniverse();
    Map vuMap = vu.getProperties();

    System.out.println("version = " + vuMap.get("j3d.version"));
    System.out.println("vendor = " + vuMap.get("j3d.vendor"));
    System.out.println("specification.version = " + vuMap.get("j3d.specification.version"));
    System.out.println("specification.vendor = " + vuMap.get("j3d.specification.vendor"));
    System.out.println("renderer = " + vuMap.get("j3d.renderer") + "\n");

    GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();

    /*/*from   w ww  .  jav  a2s. c  o m*/
     * We need to set this to force choosing a pixel format that support the
     * canvas.
     */
    template.setStereo(template.PREFERRED);
    template.setSceneAntialiasing(template.PREFERRED);

    GraphicsConfiguration config = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
            .getBestConfiguration(template);

    Map c3dMap = new Canvas3D(config).queryProperties();

    System.out.println("Renderer version = " + c3dMap.get("native.version"));
    System.out.println("doubleBufferAvailable = " + c3dMap.get("doubleBufferAvailable"));
    System.out.println("stereoAvailable = " + c3dMap.get("stereoAvailable"));
    System.out.println("sceneAntialiasingAvailable = " + c3dMap.get("sceneAntialiasingAvailable"));
    System.out.println("sceneAntialiasingNumPasses = " + c3dMap.get("sceneAntialiasingNumPasses"));
    System.out.println("textureColorTableSize = " + c3dMap.get("textureColorTableSize"));
    System.out.println("textureEnvCombineAvailable = " + c3dMap.get("textureEnvCombineAvailable"));
    System.out.println("textureCombineDot3Available = " + c3dMap.get("textureCombineDot3Available"));
    System.out.println("textureCombineSubtractAvailable = " + c3dMap.get("textureCombineSubtractAvailable"));
    System.out.println("texture3DAvailable = " + c3dMap.get("texture3DAvailable"));
    System.out.println("textureCubeMapAvailable = " + c3dMap.get("textureCubeMapAvailable"));
    System.out.println("textureSharpenAvailable = " + c3dMap.get("textureSharpenAvailable"));
    System.out.println("textureDetailAvailable = " + c3dMap.get("textureDetailAvailable"));
    System.out.println("textureFilter4Available = " + c3dMap.get("textureFilter4Available"));
    System.out
            .println("textureAnisotropicFilterDegreeMax = " + c3dMap.get("textureAnisotropicFilterDegreeMax"));
    System.out.println("textureBoundaryWidthMax = " + c3dMap.get("textureBoundaryWidthMax"));
    System.out.println("textureWidthMax = " + c3dMap.get("textureWidthMax"));
    System.out.println("textureHeightMax = " + c3dMap.get("textureHeightMax"));
    System.out.println("textureLodOffsetAvailable = " + c3dMap.get("textureLodOffsetAvailable"));
    System.out.println("textureLodRangeAvailable = " + c3dMap.get("textureLodRangeAvailable"));
    System.out.println("textureUnitStateMax = " + c3dMap.get("textureUnitStateMax"));
    System.out.println(
            "compressedGeometry.majorVersionNumber = " + c3dMap.get("compressedGeometry.majorVersionNumber"));
    System.out.println(
            "compressedGeometry.minorVersionNumber = " + c3dMap.get("compressedGeometry.minorVersionNumber"));
    System.out.println("compressedGeometry.minorMinorVersionNumber = "
            + c3dMap.get("compressedGeometry.minorMinorVersionNumber"));

    System.exit(0);
}

From source file:SimpleCylinder.java

public SimpleCylinder() {
    VirtualUniverse myUniverse = new VirtualUniverse();
    Locale myLocale = new Locale(myUniverse);
    myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
    myLocale.addBranchGraph(buildContentBranch());
    setTitle("SimpleCylinder");
    setSize(400, 400);/*from w ww  . ja va2  s  .  c  om*/
    setLayout(new BorderLayout());
    add("Center", myCanvas3D);
    add("South", myButton);
    myButton.addActionListener(this);
    setVisible(true);
}

From source file:SimpleCone.java

public SimpleCone() {
    VirtualUniverse myUniverse = new VirtualUniverse();
    Locale myLocale = new Locale(myUniverse);
    myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
    myLocale.addBranchGraph(buildContentBranch());
    setTitle("SimpleWorld");
    setSize(400, 400);/*from  w ww  .  j  av  a2  s.  c  o m*/
    setLayout(new BorderLayout());
    add("Center", myCanvas3D);
    add("South", myButton);
    myButton.addActionListener(this);
    setVisible(true);
}

From source file:SimpleWire.java

public SimpleWire() {
    VirtualUniverse myUniverse = new VirtualUniverse();
    Locale myLocale = new Locale(myUniverse);
    myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
    myLocale.addBranchGraph(buildContentBranch(buildShape()));
    setTitle("SimpleWire");
    setSize(400, 400);/*from w  w  w .j  ava2 s.  c  o  m*/
    setLayout(new BorderLayout());
    add("Center", myCanvas3D);
    add("South", myButton);
    myButton.addActionListener(this);
    setVisible(true);
}

From source file:SimpleSphere.java

public SimpleSphere() {
    VirtualUniverse myUniverse = new VirtualUniverse();
    Locale myLocale = new Locale(myUniverse);
    myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
    myLocale.addBranchGraph(buildContentBranch());
    setTitle("SimpleWorld");
    setSize(400, 400);/*  w ww  .ja va 2s  .  c  o m*/
    setLayout(new BorderLayout());
    add("Center", myCanvas3D);
    add("South", myButton);
    myButton.addActionListener(this);
    setVisible(true);
}

From source file:SimpleDirLight.java

/**
 * This creates a default universe and locale, creates a window and uses the
 * functions defined in this class to build the view and content branches of
 * the scene graph./*from ww  w .j  a v  a2 s  .  c o  m*/
 */
public SimpleDirLight() {
    VirtualUniverse myUniverse = new VirtualUniverse();
    Locale myLocale = new Locale(myUniverse);
    myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
    myLocale.addBranchGraph(buildContentBranch());
    setTitle("SimpleDirLight");
    setSize(400, 400);
    setLayout(new BorderLayout());
    add("Center", myCanvas3D);
    add("South", myButton);
    myButton.addActionListener(this);
    setVisible(true);
}

From source file:SimpleWorld.java

/**
 * This creates a default universe and locale, creates a window and uses the
 * functions defined in this class to build the view and content branches of
 * the scene graph./*from ww  w  .j av a2  s . c o m*/
 */
public SimpleWorld() {
    //Create a default universe and locale
    VirtualUniverse myUniverse = new VirtualUniverse();
    Locale myLocale = new Locale(myUniverse);

    //Use the functions to build the scene graph
    myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
    myLocale.addBranchGraph(buildContentBranch(buildCube()));

    //Do some AWT stuff to set up the window
    setTitle("SimpleWorld");
    setSize(400, 400);
    setLayout(new BorderLayout());
    add("Center", myCanvas3D);
    myButton.addActionListener(this);
    add("South", myButton);
    setVisible(true);
}

From source file:SimpleRotator.java

public SimpleRotator() {
    VirtualUniverse myUniverse = new VirtualUniverse();
    Locale myLocale = new Locale(myUniverse);
    myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
    //   myLocale.addBranchGraph(buildContentBranch(buildShape()));
    setTitle("SimpleRotator");
    setSize(400, 400);//w  w w . ja  va 2s .c o  m
    setLayout(new BorderLayout());
    Panel bottom = new Panel();
    bottom.add(exitButton);
    add(BorderLayout.CENTER, myCanvas3D);
    add(BorderLayout.SOUTH, bottom);
    exitButton.addActionListener(this);
    setVisible(true);
}

From source file:SimpleLOD.java

public SimpleLOD() {
    VirtualUniverse myUniverse = new VirtualUniverse();
    Locale myLocale = new Locale(myUniverse);
    myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
    myLocale.addBranchGraph(buildContentBranch());
    setTitle("SimpleLOD");
    setSize(400, 400);//  w  ww.ja  v a  2  s.co m
    setLayout(new BorderLayout());
    Panel bottom = new Panel();
    bottom.add(exitButton);
    add(BorderLayout.CENTER, myCanvas3D);
    add(BorderLayout.SOUTH, bottom);
    exitButton.addActionListener(this);
    setVisible(true);
}

From source file:SimpleKeyNav.java

public SimpleKeyNav() {
    VirtualUniverse myUniverse = new VirtualUniverse();
    Locale myLocale = new Locale(myUniverse);
    myLocale.addBranchGraph(buildViewBranch(myCanvas3D));
    myLocale.addBranchGraph(buildContentBranch());
    setTitle("SimpleKeyNav");
    setSize(400, 400);/*from   w  ww.j  a  v a  2  s .co  m*/
    setLayout(new BorderLayout());
    Panel bottom = new Panel();
    bottom.add(exitButton);
    add(BorderLayout.CENTER, myCanvas3D);
    add(BorderLayout.SOUTH, bottom);
    exitButton.addActionListener(this);
    setVisible(true);
}