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


Java TransparencyAttributes.setCapability方法代码示例

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


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

示例1: Ground3D

import javax.media.j3d.TransparencyAttributes; //导入方法依赖的package包/类
/**
 * Creates a 3D ground for the given <code>home</code>.
 */
public Ground3D(Home home, float originX, float originY, float width, float depth, boolean waitTextureLoadingEnd)
{
	setUserData(home);
	this.originX = originX;
	this.originY = originY;
	this.width = width;
	this.depth = depth;
	
	Appearance groundAppearance = new Appearance();
	groundAppearance.setCapability(Appearance.ALLOW_MATERIAL_WRITE);
	groundAppearance.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
	TextureAttributes textureAttributes = new TextureAttributes();
	textureAttributes.setTextureMode(TextureAttributes.MODULATE);
	groundAppearance.setTextureAttributes(textureAttributes);
	groundAppearance.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_READ);
	TransparencyAttributes transparencyAttributes = new TransparencyAttributes();
	transparencyAttributes.setCapability(TransparencyAttributes.ALLOW_MODE_WRITE);
	groundAppearance.setTransparencyAttributes(transparencyAttributes);
	
	final Shape3D groundShape = new Shape3D();
	groundShape.setAppearance(groundAppearance);
	groundShape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
	groundShape.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
	groundShape.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
	
	setCapability(ALLOW_CHILDREN_READ);
	
	addChild(groundShape);
	
	update(waitTextureLoadingEnd);
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:35,代码来源:Ground3D.java

示例2: createWallPartShape

import javax.media.j3d.TransparencyAttributes; //导入方法依赖的package包/类
/**
 * Returns a new wall part shape with no geometry  
 * and a default appearance with a white material.
 */
private Node createWallPartShape(boolean outline)
{
	Shape3D wallShape = new Shape3D();
	// Allow wall shape to change its geometry
	wallShape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
	wallShape.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
	wallShape.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
	
	Appearance wallAppearance = new Appearance();
	wallShape.setAppearance(wallAppearance);
	wallAppearance.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_READ);
	TransparencyAttributes transparencyAttributes = new TransparencyAttributes();
	transparencyAttributes.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE);
	transparencyAttributes.setCapability(TransparencyAttributes.ALLOW_MODE_WRITE);
	wallAppearance.setTransparencyAttributes(transparencyAttributes);
	wallAppearance.setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_READ);
	RenderingAttributes renderingAttributes = new RenderingAttributes();
	renderingAttributes.setCapability(RenderingAttributes.ALLOW_VISIBLE_WRITE);
	wallAppearance.setRenderingAttributes(renderingAttributes);
	
	if (outline)
	{
		wallAppearance.setColoringAttributes(Object3DBranch.OUTLINE_COLORING_ATTRIBUTES);
		wallAppearance.setPolygonAttributes(Object3DBranch.OUTLINE_POLYGON_ATTRIBUTES);
		wallAppearance.setLineAttributes(Object3DBranch.OUTLINE_LINE_ATTRIBUTES);
	}
	else
	{
		wallAppearance.setCapability(Appearance.ALLOW_MATERIAL_WRITE);
		wallAppearance.setMaterial(DEFAULT_MATERIAL);
		wallAppearance.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
		wallAppearance.setCapability(Appearance.ALLOW_TEXTURE_READ);
		// Mix texture and wall color
		wallAppearance.setTextureAttributes(MODULATE_TEXTURE_ATTRIBUTES);
	}
	return wallShape;
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:42,代码来源:Wall3D.java

示例3: createRoomPartShape

import javax.media.j3d.TransparencyAttributes; //导入方法依赖的package包/类
/**
 * Returns a new room part shape with no geometry  
 * and a default appearance with a white material.
 */
private Node createRoomPartShape()
{
	Shape3D roomShape = new Shape3D();
	// Allow room shape to change its geometry
	roomShape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
	roomShape.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
	roomShape.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
	
	Appearance roomAppearance = new Appearance();
	roomShape.setAppearance(roomAppearance);
	roomAppearance.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_READ);
	TransparencyAttributes transparencyAttributes = new TransparencyAttributes();
	transparencyAttributes.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE);
	transparencyAttributes.setCapability(TransparencyAttributes.ALLOW_MODE_WRITE);
	roomAppearance.setTransparencyAttributes(transparencyAttributes);
	roomAppearance.setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_READ);
	RenderingAttributes renderingAttributes = new RenderingAttributes();
	renderingAttributes.setCapability(RenderingAttributes.ALLOW_VISIBLE_WRITE);
	roomAppearance.setRenderingAttributes(renderingAttributes);
	roomAppearance.setCapability(Appearance.ALLOW_MATERIAL_WRITE);
	roomAppearance.setMaterial(DEFAULT_MATERIAL);
	roomAppearance.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
	roomAppearance.setCapability(Appearance.ALLOW_TEXTURE_READ);
	// Mix texture and room color
	roomAppearance.setTextureAttributes(MODULATE_TEXTURE_ATTRIBUTES);
	
	return roomShape;
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:33,代码来源:Room3D.java


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