本文整理汇总了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));
}
示例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();
}
}