当前位置: 首页>>代码示例>>Java>>正文


Java TransparencyAttributes.NICEST属性代码示例

本文整理汇总了Java中javax.media.j3d.TransparencyAttributes.NICEST属性的典型用法代码示例。如果您正苦于以下问题:Java TransparencyAttributes.NICEST属性的具体用法?Java TransparencyAttributes.NICEST怎么用?Java TransparencyAttributes.NICEST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.media.j3d.TransparencyAttributes的用法示例。


在下文中一共展示了TransparencyAttributes.NICEST属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Cube3dCreator

/**
 * Creates a new instance of Cube3dFactory
 *
 * length the edge length of the cube (in all directions) color the
 * color of the cube
 */
public Cube3dCreator(float length, float width, float height, Material mat, float transparency) {
    this.cubeLength = length;
    this.cubeWidth = width;
    this.cubeHeight = height;

    //this.cubeColor = color;
    // ca werden nicht benoetigt
    //ColoringAttributes ca = new ColoringAttributes();
    //ca.setColor(cubeColor);
    // this.cubeAppearance.setColoringAttributes(ca);
    this.cubeAppearance = new Appearance();

    //PolygonAttributes pa = new PolygonAttributes();
    //pa.setCullFace(PolygonAttributes.CULL_NONE);
    //this.cubeAppearance.setPolygonAttributes(pa);

    /*
    ColoringAttributes colorAtt = new ColoringAttributes();
    colorAtt.setShadeModel(ColoringAttributes.SHADE_GOURAUD);
    this.cubeAppearance.setColoringAttributes(colorAtt);
     * 
     */

    this.cubeAppearance.setMaterial(mat);
    TransparencyAttributes ta = new TransparencyAttributes(TransparencyAttributes.NICEST, transparency);
    this.cubeAppearance.setTransparencyAttributes(ta);
    this.cubeContainer = new Shape3D();
    this.cubeContainer.setAppearance(cubeAppearance);
    this.cubeContainer.removeGeometry(0);
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:36,代码来源:Cube3dCreator.java

示例2: NeuGenVisualization

public NeuGenVisualization(VisualizationTask task, BranchGroup bg, int zoom,
        VisualizationDialog.VisualMethod visMethod, boolean loadedGraph) {
    this.task = task;
    this.sceneBG = bg;
    this.scale = 1f;
    this.visMethod = visMethod;
    //this.scale *= zoom;
    //retrieve the Shape3D object from the scene
    if (loadedGraph) {
        init1();
        init2();
    } else {
        Shape3D shape = (Shape3D) sceneBG.getChild(0);
        //create an Appearance and Material
        Appearance app = new Appearance();
        app.setCapability(Appearance.ALLOW_MATERIAL_WRITE);
        app.setCapability(Appearance.ALLOW_MATERIAL_READ);
        switch (visMethod) {
            case WIRE: {
                Color3f black = new Color3f(0.0f, 0.0f, 0.0f);
                Color3f objColor = new Color3f(1.0f, 0.7f, 0.8f);
                Material mat = new Material(objColor, black, objColor, black, 80.0f);
                app.setMaterial(mat);
                PolygonAttributes pa = new PolygonAttributes();
                pa.setPolygonMode(PolygonAttributes.POLYGON_LINE);
                app.setPolygonAttributes(pa);

                ColoringAttributes colorAtt = new ColoringAttributes();
                colorAtt.setShadeModel(ColoringAttributes.SHADE_GOURAUD);
                app.setColoringAttributes(colorAtt);

                TransparencyAttributes ta = new TransparencyAttributes(TransparencyAttributes.NICEST, 0.5f);
                app.setTransparencyAttributes(ta);
                shape.setAppearance(app);
            }
        }
        init1();
        spinner = createSpinner();
        sceneBG.addChild(spinner);
        setLightingRecon(spinner);
        addBackground(sceneBG);
        addKeyNavigator(sceneBG);
        init2();
    }
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:45,代码来源:NeuGenVisualization.java

示例3: createTransparency

TransparencyAttributes createTransparency() {
    return (Float.isNaN(t) ? null : new TransparencyAttributes(TransparencyAttributes.NICEST, t));
}
 
开发者ID:hlg,项目名称:billie,代码行数:3,代码来源:ColorScale.java

示例4: generateApparence

/**
 * Permet de créer l'apparence en fonction de paramètres Dans le cadre d'un
 * ponctuel, certains paramètres n'ont aucun sens
 * 
 * @param color couleur
 * @param coefOpacity coefficient d'opacité
 * @param isSolid mode solide
 * @return
 */
private static Appearance generateApparence(Color color, double coefOpacity,
    boolean isSolid) {

  // Création de l'apparence
  Appearance apparenceFinale = new Appearance();

  // Autorisations pour l'apparence
  apparenceFinale.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_READ);
  apparenceFinale.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_WRITE);

  // Autorisations pour le material
  apparenceFinale.setCapability(Appearance.ALLOW_MATERIAL_READ);
  apparenceFinale.setCapability(Appearance.ALLOW_MATERIAL_WRITE);
  apparenceFinale.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);
  apparenceFinale.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);

  // Création du material (gestion des couleurs et de l'affichage)
  Material material = new Material();

  Color3f col3f = new Color3f(color);

  material.setAmbientColor(col3f);
  material.setDiffuseColor(col3f);
  material.setEmissiveColor(col3f);
  material.setLightingEnable(true);
  material.setSpecularColor(col3f);
  material.setShininess(1);

  // et de material
  apparenceFinale.setMaterial(material);

  if (coefOpacity != 1) {

    TransparencyAttributes t_attr =

    new TransparencyAttributes(TransparencyAttributes.NICEST,
        (float) (1 - coefOpacity));

    apparenceFinale.setTransparencyAttributes(t_attr);
  }

  // Création des attributs du polygone
  PolygonAttributes pa = new PolygonAttributes();

  pa.setCullFace(PolygonAttributes.CULL_NONE);
  pa.setCapability(PolygonAttributes.ALLOW_CULL_FACE_WRITE);

  if (isSolid) {

    pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);

    if (ConstantRepresentation.cullMode) {
      pa.setCullFace(PolygonAttributes.CULL_BACK);

    }

  } else {

    pa.setPolygonMode(PolygonAttributes.POLYGON_LINE);

  }

  pa.setBackFaceNormalFlip(false);

  // Association à l'apparence des attributs de géométrie et de material
  apparenceFinale.setPolygonAttributes(pa);

  return apparenceFinale;

}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:79,代码来源:Level.java

示例5: generateAppearance

/**
 * Génère l'apparence de l'objet de type texture d'un objet
 * 
 * @return
 */
private Appearance generateAppearance(Texture2D tex) {

  // Création de l'apparence
  Appearance apparenceFinale = new Appearance();

  // Autorisations pour l'apparence
  apparenceFinale.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_READ);
  apparenceFinale.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_WRITE);

  // Autorisations pour le material

  apparenceFinale.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);
  apparenceFinale.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);

  apparenceFinale.setCapability(Appearance.ALLOW_TEXTURE_ATTRIBUTES_READ);
  apparenceFinale.setCapability(Appearance.ALLOW_TEXTURE_ATTRIBUTES_WRITE);

  apparenceFinale.setCapability(Appearance.ALLOW_TEXTURE_WRITE);

  apparenceFinale.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);

  apparenceFinale.setTexture(tex);
  apparenceFinale.setTextureAttributes(new TextureAttributes());

  // Création des attributs du polygone
  PolygonAttributes pa = new PolygonAttributes();

  pa.setCullFace(PolygonAttributes.CULL_NONE);
  pa.setCapability(PolygonAttributes.ALLOW_CULL_FACE_WRITE);

  pa.setBackFaceNormalFlip(false);

  // Association à l'apparence des attributs de géométrie et de material
  apparenceFinale.setPolygonAttributes(pa);

  TransparencyAttributes t_attr = new TransparencyAttributes(
      TransparencyAttributes.NICEST, 0,
      TransparencyAttributes.BLEND_ONE_MINUS_SRC_ALPHA,
      TransparencyAttributes.BLEND_ONE_MINUS_SRC_ALPHA);
  apparenceFinale.setTransparencyAttributes(t_attr);

  return apparenceFinale;

}
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:49,代码来源:NPA.java


注:本文中的javax.media.j3d.TransparencyAttributes.NICEST属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。