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


Java ColoringAttributes.setShadeModel方法代码示例

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


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

示例1: RepresentationTin

import javax.media.j3d.ColoringAttributes; //导入方法依赖的package包/类
public RepresentationTin(ITriangulatedSurface tin, Color[] colorShade,
    int method) {
  super();
  this.nbClasses = colorShade.length;
  Box3D b = new Box3D(tin.coord());
  this.zMin = b.getLLDP().getZ();
  this.zMax = b.getURDP().getZ();
  this.colorShade = toColor3f(colorShade);
  this.method = METHOD_LINEAR;
  this.tin = tin;
  GeometryInfo geoInfo = fromOrientableSToTriangleArray();

  Appearance app = new Appearance();

  ColoringAttributes at = new ColoringAttributes();
  at.setShadeModel(ColoringAttributes.NICEST);

  app.setColoringAttributes(at);

  this.bGRep.addChild(new Shape3D(geoInfo.getGeometryArray(), app));

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

示例2: NeuGenVisualization

import javax.media.j3d.ColoringAttributes; //导入方法依赖的package包/类
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,代码行数:46,代码来源:NeuGenVisualization.java


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