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


Java Appearance.getTransparencyAttributes方法代码示例

本文整理汇总了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);
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:39,代码来源:Wall3D.java

示例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();
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:10,代码来源:HomePieceOfFurniture3D.java

示例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);
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:45,代码来源:Room3D.java


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