本文整理汇总了Java中javax.media.j3d.Appearance.getTransparencyAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java Appearance.getTransparencyAttributes方法的具体用法?Java Appearance.getTransparencyAttributes怎么用?Java Appearance.getTransparencyAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.media.j3d.Appearance
的用法示例。
在下文中一共展示了Appearance.getTransparencyAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateFilledWallSideAppearance
import javax.media.j3d.Appearance; //导入方法依赖的package包/类
/**
* Sets filled wall side appearance with its color, texture, transparency and visibility.
*/
private void updateFilledWallSideAppearance(final Appearance wallSideAppearance, final HomeTexture wallSideTexture,
boolean waitTextureLoadingEnd, Integer wallSideColor, float shininess)
{
if (wallSideTexture == null)
{
wallSideAppearance.setMaterial(getMaterial(wallSideColor, wallSideColor, shininess));
wallSideAppearance.setTexture(null);
}
else
{
// Update material and texture of wall side
wallSideAppearance.setMaterial(getMaterial(DEFAULT_COLOR, DEFAULT_AMBIENT_COLOR, shininess));
final TextureManager textureManager = TextureManager.getInstance();
textureManager.loadTexture(wallSideTexture.getImage(), wallSideTexture.getAngle(), waitTextureLoadingEnd,
new TextureManager.TextureObserver()
{
public void textureUpdated(Texture texture)
{
wallSideAppearance.setTexture(getHomeTextureClone(texture, home));
}
});
}
// Update wall side transparency
float wallsAlpha = this.home.getEnvironment().getWallsAlpha();
TransparencyAttributes transparencyAttributes = wallSideAppearance.getTransparencyAttributes();
transparencyAttributes.setTransparency(wallsAlpha);
// If walls alpha is equal to zero, turn off transparency to get better results
transparencyAttributes
.setTransparencyMode(wallsAlpha == 0 ? TransparencyAttributes.NONE : TransparencyAttributes.NICEST);
// Update wall side visibility
RenderingAttributes renderingAttributes = wallSideAppearance.getRenderingAttributes();
HomeEnvironment.DrawingMode drawingMode = this.home.getEnvironment().getDrawingMode();
renderingAttributes.setVisible(drawingMode == null || drawingMode == HomeEnvironment.DrawingMode.FILL
|| drawingMode == HomeEnvironment.DrawingMode.FILL_AND_OUTLINE);
}
示例2: DefaultMaterialAndTexture
import javax.media.j3d.Appearance; //导入方法依赖的package包/类
public DefaultMaterialAndTexture(Appearance appearance)
{
this.material = appearance.getMaterial();
this.transparencyAttributes = appearance.getTransparencyAttributes();
this.polygonAttributes = appearance.getPolygonAttributes();
this.texCoordGeneration = appearance.getTexCoordGeneration();
this.texture = appearance.getTexture();
this.textureAttributes = appearance.getTextureAttributes();
}
示例3: updateRoomPartAppearance
import javax.media.j3d.Appearance; //导入方法依赖的package包/类
/**
* Sets room part appearance with its color, texture and visibility.
*/
private void updateRoomPartAppearance(final Appearance roomPartAppearance, final HomeTexture roomPartTexture,
boolean waitTextureLoadingEnd, Integer roomPartColor, float shininess, boolean visible,
boolean ignoreTransparency)
{
if (roomPartTexture == null)
{
roomPartAppearance.setMaterial(getMaterial(roomPartColor, roomPartColor, shininess));
roomPartAppearance.setTexture(null);
}
else
{
// Update material and texture of room part
roomPartAppearance.setMaterial(getMaterial(DEFAULT_COLOR, DEFAULT_AMBIENT_COLOR, shininess));
final TextureManager textureManager = TextureManager.getInstance();
textureManager.loadTexture(roomPartTexture.getImage(), roomPartTexture.getAngle(), waitTextureLoadingEnd,
new TextureManager.TextureObserver()
{
public void textureUpdated(Texture texture)
{
texture = getHomeTextureClone(texture, home);
if (roomPartAppearance.getTexture() != texture)
{
roomPartAppearance.setTexture(texture);
}
}
});
}
if (!ignoreTransparency)
{
// Update room part transparency
float upperRoomsAlpha = this.home.getEnvironment().getWallsAlpha();
TransparencyAttributes transparencyAttributes = roomPartAppearance.getTransparencyAttributes();
transparencyAttributes.setTransparency(upperRoomsAlpha);
// If alpha is equal to zero, turn off transparency to get better results
transparencyAttributes.setTransparencyMode(
upperRoomsAlpha == 0 ? TransparencyAttributes.NONE : TransparencyAttributes.NICEST);
}
// Update room part visibility
RenderingAttributes renderingAttributes = roomPartAppearance.getRenderingAttributes();
renderingAttributes.setVisible(visible);
}