本文整理汇总了Java中javax.media.j3d.PolygonAttributes.setCullFace方法的典型用法代码示例。如果您正苦于以下问题:Java PolygonAttributes.setCullFace方法的具体用法?Java PolygonAttributes.setCullFace怎么用?Java PolygonAttributes.setCullFace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.j3d.PolygonAttributes
的用法示例。
在下文中一共展示了PolygonAttributes.setCullFace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAppearance
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
private void createAppearance() {
Appearance app = new Appearance();
PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
// so can see the ColouredTiles from both sides
app.setPolygonAttributes(pa);
setAppearance(app);
}
示例2: SlicePlane3DRenderer
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
public SlicePlane3DRenderer(View view, Context context, Volume vol)
{
super(view, context, vol);
texVol = new Texture3DVolume(context, vol);
TransparencyAttributes transAttr = new TransparencyAttributes();
transAttr.setTransparencyMode(TransparencyAttributes.BLENDED);
texAttr = new TextureAttributes();
texAttr.setTextureMode(TextureAttributes.MODULATE);
texAttr.setCapability(TextureAttributes.ALLOW_COLOR_TABLE_WRITE);
Material m = new Material();
m.setLightingEnable(false);
PolygonAttributes p = new PolygonAttributes();
p.setCullFace(PolygonAttributes.CULL_NONE);
p.setPolygonOffset(1.0f);
p.setPolygonOffsetFactor(1.0f);
appearance = new Appearance();
appearance.setMaterial(m);
appearance.setTextureAttributes(texAttr);
appearance.setTransparencyAttributes(transAttr);
appearance.setPolygonAttributes(p);
appearance.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
appearance.setCapability(Appearance.ALLOW_TEXGEN_WRITE);
shape = new Shape3D(null, appearance);
shape.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
shape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
root.addChild(shape);
}
示例3: CorticalColumn
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
public CorticalColumn(float scale) {
super();
this.scale = scale;
Region.Param.ColumnParam par = Region.Param.getInstance().getColumnParam();
lengthX = par.getLength() * scale;
widthY = par.getWidth() * scale;
layer1 = par.getLayer1() * scale;
layer23 = par.getLayer23() * scale;
layer4 = par.getLayer4() * scale;
layer5A = par.getLayer5A() * scale;
layer5B = par.getLayer5B() * scale;
layer6 = par.getLayer6() * scale;
heightZ = par.getHeight() * scale;
Appearance ap = new Appearance();
ColoringAttributes ca = new ColoringAttributes();
ca.setColor(Utils3D.grey);
ap.setColoringAttributes(ca);
TransparencyAttributes myTA = new TransparencyAttributes();
myTA.setTransparency(0.7f);
myTA.setTransparencyMode(TransparencyAttributes.NICEST);
ap.setTransparencyAttributes(myTA);
//render the Box as a wire frame
PolygonAttributes polyAttrbutes = new PolygonAttributes();
polyAttrbutes.setPolygonMode(PolygonAttributes.POLYGON_LINE);
polyAttrbutes.setCullFace(PolygonAttributes.CULL_NONE);
ap.setPolygonAttributes(polyAttrbutes);
setAppearance(ap);
}
示例4: RegionCA1
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
public RegionCA1(float scale) {
super();
this.scale = scale;
Region.Param.CA1Param regPar = Region.Param.getInstance().getCa1Param();
lengthX = regPar.getLength() * scale;
widthY = regPar.getWidth() * scale;
stratumOriens = regPar.getStratumOriens() * scale;
stratumPyramidale = regPar.getStratumPyramidale() * scale;
stratumRadiatum = regPar.getStratumRadiatum() * scale;
stratumLacunosum = regPar.getStratumLacunosum() * scale;
heightZ = regPar.getHeight() * scale;
Appearance ap = new Appearance();
ColoringAttributes ca = new ColoringAttributes();
ca.setColor(Utils3D.grey);
ap.setColoringAttributes(ca);
TransparencyAttributes myTA = new TransparencyAttributes();
myTA.setTransparency(0.7f);
myTA.setTransparencyMode(TransparencyAttributes.FASTEST);
ap.setTransparencyAttributes(myTA);
//render the Box as a wire frame
PolygonAttributes polyAttrbutes = new PolygonAttributes();
polyAttrbutes.setPolygonMode(PolygonAttributes.POLYGON_LINE);
polyAttrbutes.setCullFace(PolygonAttributes.CULL_NONE);
ap.setPolygonAttributes(polyAttrbutes);
setAppearance(ap);
}
示例5: createMaterialAppearance
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private static Appearance createMaterialAppearance() {
Appearance materialAppear = new Appearance();
PolygonAttributes polyAttrib = new PolygonAttributes();
polyAttrib.setCullFace(PolygonAttributes.CULL_NONE);
materialAppear.setPolygonAttributes(polyAttrib);
Material material = new Material();
material.setDiffuseColor(ColorUtil.red);
materialAppear.setMaterial(material);
return materialAppear;
}
示例6: createAppearance
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
private void createAppearance() {
Appearance app = new Appearance();
PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
// so can see the ColouredTiles from both sides
app.setPolygonAttributes(pa);
setAppearance(app);
}
示例7: main
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
public static void main(String[] args) throws FileNotFoundException, PluginException {
SimplePluginManager pluginManager = new SimplePluginManager();
BimserverStoreyLoader loader = new BimserverStoreyLoader(pluginManager);
Appearance noCullingAppearance = TypeAppearance.IfcWallImpl.createAppearance();
PolygonAttributes pgonAttrs = new PolygonAttributes();
pgonAttrs.setCullFace(PolygonAttributes.CULL_NONE);
noCullingAppearance.setPolygonAttributes(pgonAttrs);
loader.setDefaultAppearance(noCullingAppearance);
ExplodedAxonometrie ifcViewer = new ExplodedAxonometrie(loader);
ifcViewer.chooseAndRun(args.length > 0 ? args[0] : null, "ifc", false);
}
示例8: generateMaterial
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
/**
* Missing setSmoothness et ambientIntensity
*
* @param X3Dmaterial
* @return
*/
private void generateMaterial(CG_X3DMaterial X3Dmaterial) {
// Autorisations pour l'apparence
this.apparenceFinale.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_READ);
this.apparenceFinale.setCapability(Appearance.ALLOW_POLYGON_ATTRIBUTES_WRITE);
// Autorisations pour le material
this.apparenceFinale.setCapability(Appearance.ALLOW_MATERIAL_READ);
this.apparenceFinale.setCapability(Appearance.ALLOW_MATERIAL_WRITE);
this.apparenceFinale.setCapability(Appearance.ALLOW_TEXTURE_ATTRIBUTES_READ);
this.apparenceFinale.setCapability(Appearance.ALLOW_TEXTURE_ATTRIBUTES_WRITE);
this.apparenceFinale.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
// Création des attributs du polygone
PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
pa.setCapability(PolygonAttributes.ALLOW_CULL_FACE_WRITE);
// Indique que l'on est en mode surfacique
pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
pa.setBackFaceNormalFlip(false);
// Association à l'apparence des attributs de géométrie et de material
this.apparenceFinale.setPolygonAttributes(pa);
Material material = new Material();
material.setShininess(X3Dmaterial.getShininess().floatValue());
material.setSpecularColor(X3Dmaterial.getSpecularColor());
material.setDiffuseColor(X3Dmaterial.getDiffuseColor());
material.setEmissiveColor(X3Dmaterial.getEmissiveColor());
this.apparenceFinale.setMaterial(material);
if (X3Dmaterial.getTransparency() != 0) {
TransparencyAttributes t_attr = new TransparencyAttributes(TransparencyAttributes.BLENDED,
X3Dmaterial.getTransparency().floatValue(), TransparencyAttributes.BLEND_SRC_ALPHA,
TransparencyAttributes.BLENDED);
this.apparenceFinale.setTransparencyAttributes(t_attr);
}
CG_StyleGenerator.lMaterial.add(X3Dmaterial);
CG_StyleGenerator.lAppearance.add(this.apparenceFinale);
}
示例9: generateAppearance
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
/**
* Génère l'apparence à appliquer à la géométrie
*
* @param isClrd
* @param color
* @param coefOpacity
* @param isSolid
* @return
*/
private Appearance generateAppearance(boolean isClrd, 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);
// Création des attributs du polygone
PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
pa.setCapability(PolygonAttributes.ALLOW_CULL_FACE_WRITE);
if (isSolid) {
// Indique que l'on est en mode surfacique
pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
// Indique que l'on n'affiche pas les faces cachées
if (ConstantRepresentation.cullMode) {
pa.setCullFace(PolygonAttributes.CULL_BACK);
}
} else {
// Indique que l'on est en mode filaire
pa.setPolygonMode(PolygonAttributes.POLYGON_LINE);
}
pa.setCullFace(PolygonAttributes.CULL_NONE);
pa.setBackFaceNormalFlip(false);
// Association à l'apparence des attributs de géométrie et de material
apparenceFinale.setPolygonAttributes(pa);
if (isClrd) {
Color3f couleur3F = new Color3f(color);
// Création du material (gestion des couleurs et de l'affichage)
Material material = new Material();
material.setAmbientColor(couleur3F);
material.setDiffuseColor(couleur3F);
material.setEmissiveColor(couleur3F);
material.setLightingEnable(true);
material.setSpecularColor(couleur3F);
material.setShininess(1);
apparenceFinale.setMaterial(material);
}
if (coefOpacity != 1) {
TransparencyAttributes t_attr =
new TransparencyAttributes(TransparencyAttributes.FASTEST,
(float) (1 - coefOpacity));
apparenceFinale.setTransparencyAttributes(t_attr);
}
return apparenceFinale;
}
示例10: generateAppearance
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
/**
* Génère l'apparence à appliquer à la géométrie
*
* @param isClrd
* @param color
* @param coefOpacity
* @param isSolid
* @return
*/
private Appearance generateAppearance(boolean isClrd, 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);
// Création des attributs du polygone
PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
pa.setCapability(PolygonAttributes.ALLOW_CULL_FACE_WRITE);
if (isSolid) {
// Indique que l'on est en mode surfacique
pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
// Indique que l'on n'affiche pas les faces cachées
} else {
// Indique que l'on est en mode filaire
pa.setPolygonMode(PolygonAttributes.POLYGON_LINE);
}
pa.setBackFaceNormalFlip(false);
// Association à l'apparence des attributs de géométrie et de material
apparenceFinale.setPolygonAttributes(pa);
if (isClrd) {
Color3f couleur3F = new Color3f(color);
// Création du material (gestion des couleurs et de l'affichage)
Material material = new Material();
material.setAmbientColor(couleur3F);
material.setDiffuseColor(couleur3F);
material.setSpecularColor(couleur3F);
material.setEmissiveColor(couleur3F);
material.setShininess(1);
apparenceFinale.setMaterial(material);
}
if (coefOpacity != 1) {
TransparencyAttributes t_attr = new TransparencyAttributes(
TransparencyAttributes.BLENDED, (float) coefOpacity,
TransparencyAttributes.BLEND_SRC_ALPHA,
TransparencyAttributes.BLENDED);
apparenceFinale.setTransparencyAttributes(t_attr);
}
return apparenceFinale;
}
示例11: generateAppearance
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
/**
* Génère l'apparence à appliquer à la géométrie
*
* @param isClrd
* @param color
* @param coefTransp
* @param isSolid
* @return
*/
private Appearance generateAppearance(boolean isClrd, Color color,
double coefTransp, 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);
// Création des attributs du polygone
PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
pa.setCapability(PolygonAttributes.ALLOW_CULL_FACE_WRITE);
if (isSolid) {
// Indique que l'on est en mode surfacique
pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
// Indique que l'on n'affiche pas les faces cachées
if (ConstantRepresentation.cullMode) {
pa.setCullFace(PolygonAttributes.CULL_BACK);
}
} else {
// Indique que l'on est en mode filaire
pa.setPolygonMode(PolygonAttributes.POLYGON_LINE);
}
pa.setBackFaceNormalFlip(false);
// Association à l'apparence des attributs de géométrie et de material
apparenceFinale.setPolygonAttributes(pa);
if (isClrd) {
Color3f couleur3F = new Color3f(color);
// Création du material (gestion des couleurs et de l'affichage)
Material material = new Material();
material.setDiffuseColor(couleur3F);
material.setSpecularColor(new Color3f(color.brighter()));
material.setAmbientColor(new Color3f(color.darker()));
material.setEmissiveColor(new Color3f(color.darker()));
material.setShininess(128);
apparenceFinale.setMaterial(material);
}
if (coefTransp != 1) {
TransparencyAttributes t_attr = new TransparencyAttributes(
TransparencyAttributes.BLENDED, (float) coefTransp,
TransparencyAttributes.BLEND_SRC_ALPHA,
TransparencyAttributes.BLENDED);
apparenceFinale.setTransparencyAttributes(t_attr);
}
return apparenceFinale;
}
示例12: generateAppearance
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
/**
* Génère l'apparence à appliquer à la géométrie
*
* @param isClrd
* @param color
* @param coefTransp
* @param isSolid
* @return
*/
private Appearance generateAppearance(boolean isClrd, Color color,
double coefTransp, 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);
// Création des attributs du polygone
PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
pa.setCapability(PolygonAttributes.ALLOW_CULL_FACE_WRITE);
if (isSolid) {
// Indique que l'on est en mode surfacique
pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
// Indique que l'on n'affiche pas les faces cachées
if (ConstantRepresentation.cullMode) {
pa.setCullFace(PolygonAttributes.CULL_BACK);
}
} else {
// Indique que l'on est en mode filaire
pa.setPolygonMode(PolygonAttributes.POLYGON_LINE);
}
pa.setBackFaceNormalFlip(false);
// Association à l'apparence des attributs de géométrie et de material
apparenceFinale.setPolygonAttributes(pa);
if (isClrd) {
Color3f couleur3F = new Color3f(color);
// Création du material (gestion des couleurs et de l'affichage)
Material material = new Material();
material.setDiffuseColor(couleur3F);
material.setSpecularColor(new Color3f(color.brighter()));
material.setAmbientColor(new Color3f(color.darker()));
material.setShininess(128);
apparenceFinale.setMaterial(material);
}
if (coefTransp != 1) {
TransparencyAttributes t_attr = new TransparencyAttributes(
TransparencyAttributes.BLENDED, (float) coefTransp,
TransparencyAttributes.BLEND_SRC_ALPHA,
TransparencyAttributes.BLENDED);
apparenceFinale.setTransparencyAttributes(t_attr);
}
return apparenceFinale;
}
示例13: setCullMode
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
/**
* Affichage ou non des faces dont la normale ne fait pas face à la caméra
*
* @param cull
*/
public void setCullMode(boolean cull) {
PolygonAttributes pa = this.getShapes().get(0).getAppearance()
.getPolygonAttributes();
if (ConstantRepresentation.cullMode) {
pa.setCullFace(PolygonAttributes.CULL_BACK);
} else {
pa.setCullFace(PolygonAttributes.CULL_NONE);
}
this.getShapes().get(0).getAppearance().setPolygonAttributes(pa);
}
示例14: initBGSel
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
/**
* Permet de créer un BranchGroup contenant une sphère Elle servira à indiquer
* si un objet est selectionné
*/
private void initBGSel() {
// On initialise la selection
// On récupère la sphère englobante de l'objet
BoundingSphere bs = new BoundingSphere(this.bGRep.getBounds());
Point3d pt = new Point3d();
bs.getCenter(pt);
// On place le sphère aux bonnes coordonnées
Transform3D translate = new Transform3D();
translate.set(new Vector3f((float) pt.getX(), (float) pt.getY(), (float) pt
.getZ()));
// 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);
// Création des attributs du polygone
PolygonAttributes pa = new PolygonAttributes();
pa.setCullFace(PolygonAttributes.CULL_NONE);
pa.setCapability(PolygonAttributes.ALLOW_CULL_FACE_WRITE);
// Indique que l'on est en mode surfacique
pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
pa.setCullFace(PolygonAttributes.CULL_BACK);
pa.setBackFaceNormalFlip(false);
Color3f couleur3F = new Color3f(ConstantRepresentation.selectionColor);
// Création du material (gestion des couleurs et de l'affichage)
Material material = new Material();
material.setAmbientColor(couleur3F.x / 2, couleur3F.y / 2, couleur3F.z / 2);
material.setDiffuseColor(couleur3F);
material.setSpecularColor(new Color3f(1.0f, 1.0f, 1.0f));
material.setShininess(128);
apparenceFinale.setMaterial(material);
// On applique l'apparence à la sphère
Sphere sphere = new Sphere((float) bs.getRadius(), apparenceFinale);
TransparencyAttributes t_attr = new TransparencyAttributes(
TransparencyAttributes.BLENDED, (float) 0.5,
TransparencyAttributes.BLEND_SRC_ALPHA, TransparencyAttributes.BLENDED);
apparenceFinale.setTransparencyAttributes(t_attr);
TransformGroup TG1 = new TransformGroup(translate);
TG1.addChild(sphere);
this.bgSel = new BranchGroup();
this.bgSel.setCapability(BranchGroup.ALLOW_DETACH);
this.bgSel.addChild(TG1);
}
示例15: setCullMode
import javax.media.j3d.PolygonAttributes; //导入方法依赖的package包/类
/**
* @param cull
*/
public void setCullMode(boolean cull) {
PolygonAttributes pa = this.getShapes().get(0).getAppearance()
.getPolygonAttributes();
if (ConstantRepresentation.cullMode) {
pa.setCullFace(PolygonAttributes.CULL_BACK);
} else {
pa.setCullFace(PolygonAttributes.CULL_NONE);
}
this.getShapes().get(0).getAppearance().setPolygonAttributes(pa);
}