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


Java RenderingAttributes.setCapability方法代码示例

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


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

示例1: DebugVector

import javax.media.j3d.RenderingAttributes; //导入方法依赖的package包/类
public DebugVector( Point3f location , Vector3f extent , Color3f color )
{
	ColoringAttributes ca = new ColoringAttributes( );
	ca.setCapability( ColoringAttributes.ALLOW_COLOR_WRITE );
	RenderingAttributes ra = new RenderingAttributes( );
	ra.setCapability( RenderingAttributes.ALLOW_VISIBLE_WRITE );
	TransparencyAttributes ta = new TransparencyAttributes( );
	ta.setTransparency( 0.3f );
	Appearance app = new Appearance( );
	app.setColoringAttributes( ca );
	app.setCapability( Appearance.ALLOW_COLORING_ATTRIBUTES_READ );
	app.setRenderingAttributes( ra );
	app.setCapability( Appearance.ALLOW_RENDERING_ATTRIBUTES_READ );
	shape.setAppearance( app );
	shape.setCapability( Shape3D.ALLOW_APPEARANCE_READ );
	shape.setCapability( Shape3D.ALLOW_GEOMETRY_WRITE );
	
	setVector( location , extent );
	setColor( color );
	
	addChild( shape );
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:23,代码来源:DebugVector.java

示例2: createWallPartShape

import javax.media.j3d.RenderingAttributes; //导入方法依赖的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: setOutlineAppearance

import javax.media.j3d.RenderingAttributes; //导入方法依赖的package包/类
/**
 * Sets the outline appearance on all the children of <code>node</code>.
 */
private void setOutlineAppearance(Node node)
{
	if (node instanceof Group)
	{
		Enumeration<?> enumeration = ((Group) node).getAllChildren();
		while (enumeration.hasMoreElements())
		{
			setOutlineAppearance((Node) enumeration.nextElement());
		}
	}
	else if (node instanceof Link)
	{
		setOutlineAppearance(((Link) node).getSharedGroup());
	}
	else if (node instanceof Shape3D)
	{
		Appearance outlineAppearance = new Appearance();
		((Shape3D) node).setAppearance(outlineAppearance);
		outlineAppearance.setCapability(Appearance.ALLOW_RENDERING_ATTRIBUTES_READ);
		RenderingAttributes renderingAttributes = new RenderingAttributes();
		renderingAttributes.setCapability(RenderingAttributes.ALLOW_VISIBLE_WRITE);
		outlineAppearance.setRenderingAttributes(renderingAttributes);
		outlineAppearance.setColoringAttributes(Object3DBranch.OUTLINE_COLORING_ATTRIBUTES);
		outlineAppearance.setPolygonAttributes(Object3DBranch.OUTLINE_POLYGON_ATTRIBUTES);
		outlineAppearance.setLineAttributes(Object3DBranch.OUTLINE_LINE_ATTRIBUTES);
	}
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:31,代码来源:HomePieceOfFurniture3D.java

示例4: createRoomPartShape

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