Example usage for javax.media.j3d GraphicsConfigTemplate3D setSceneAntialiasing

List of usage examples for javax.media.j3d GraphicsConfigTemplate3D setSceneAntialiasing

Introduction

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

Prototype

public void setSceneAntialiasing(int value) 

Source Link

Document

Sets the scene antialiasing requirement.

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  w w  .  j a v  a  2  s  .c  om
     * 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:MixedTest.java

protected Canvas3D createCanvas3D() {
    GraphicsConfigTemplate3D gc3D = new GraphicsConfigTemplate3D();
    gc3D.setSceneAntialiasing(GraphicsConfigTemplate.PREFERRED);
    GraphicsDevice gd[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();

    Canvas3D c3d = new Canvas3D(gd[0].getBestConfiguration(gc3D));
    c3d.setSize(getCanvas3dWidth(c3d), getCanvas3dHeight(c3d));

    return c3d;/*w w  w . j ava  2 s.c  o  m*/
}

From source file:MixedTest.java

protected Canvas3D createCanvas3D() {
    // overidden this method to create a custom
    // Canvas3D that will implement the Immediate Mode rendering
    GraphicsConfigTemplate3D gc3D = new GraphicsConfigTemplate3D();
    gc3D.setSceneAntialiasing(GraphicsConfigTemplate.PREFERRED);
    GraphicsDevice gd[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();

    ImmediateCanvas3D c3d = new ImmediateCanvas3D(gd[0].getBestConfiguration(gc3D));
    c3d.setSize(getCanvas3dWidth(c3d), getCanvas3dHeight(c3d));

    return (Canvas3D) c3d;
}

From source file:RasterTest.java

protected Canvas3D createCanvas3D() {
    // create a custom Canvas3D with postSwap overidden
    GraphicsConfigTemplate3D gc3D = new GraphicsConfigTemplate3D();
    gc3D.setSceneAntialiasing(GraphicsConfigTemplate.PREFERRED);
    GraphicsDevice gd[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();

    RasterCanvas3D c3d = new RasterCanvas3D(this, gd[0].getBestConfiguration(gc3D));
    c3d.setSize(getCanvas3dWidth(c3d), getCanvas3dHeight(c3d));

    return c3d;/*w  w  w.j  a  v  a  2s. com*/
}

From source file:SwingTest.java

/**
 * Create a Canvas3D.//w w w .  jav  a  2s.co m
 * 
 * @param offscreen
 *            true to specify an offscreen canvas
 */
protected Canvas3D createCanvas3D(boolean offscreen) {
    GraphicsConfigTemplate3D gc3D = new GraphicsConfigTemplate3D();
    gc3D.setSceneAntialiasing(GraphicsConfigTemplate.PREFERRED);
    GraphicsDevice gd[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();

    Canvas3D c3d = new Canvas3D(gd[0].getBestConfiguration(gc3D), offscreen);
    c3d.setSize(500, 500);

    return c3d;
}