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


Java Shape3D.getGeometry方法代码示例

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


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

示例1: visualizeNormals

import javax.media.j3d.Shape3D; //导入方法依赖的package包/类
public static Shape3D visualizeNormals( Shape3D shape , float scale , boolean local , Appearance app )
{
	final GeometryArray geomArray = ( GeometryArray ) shape.getGeometry( );
	
	LineArray rendered;
	
	if( geomArray instanceof IndexedGeometryArray )
	{
		final IndexedGeometryArray indexedGeomArray = ( IndexedGeometryArray ) geomArray;
		rendered = renderNormals( indexedGeomArray , scale );
	}
	else
	{
		rendered = renderNormals( geomArray , scale );
	}
	
	if( !local )
	{
		final Transform3D localToVworld = new Transform3D( );
		shape.getLocalToVworld( localToVworld );
		transformCoordinates( rendered , localToVworld );
	}
	
	return new Shape3D( rendered , app );
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:26,代码来源:J3DUtils.java

示例2: getVertexCount

import javax.media.j3d.Shape3D; //导入方法依赖的package包/类
/**
 * Returns the total count of vertices in all geometries.
 */
private int getVertexCount(Node node)
{
	int count = 0;
	if (node instanceof Group)
	{
		// Enumerate all children
		Enumeration<?> enumeration = ((Group) node).getAllChildren();
		while (enumeration.hasMoreElements())
		{
			count += getVertexCount((Node) enumeration.nextElement());
		}
	}
	else if (node instanceof Link)
	{
		count = getVertexCount(((Link) node).getSharedGroup());
	}
	else if (node instanceof Shape3D)
	{
		Shape3D shape = (Shape3D) node;
		Appearance appearance = shape.getAppearance();
		RenderingAttributes renderingAttributes = appearance != null ? appearance.getRenderingAttributes() : null;
		if (renderingAttributes == null || renderingAttributes.getVisible())
		{
			for (int i = 0, n = shape.numGeometries(); i < n; i++)
			{
				Geometry geometry = shape.getGeometry(i);
				if (geometry instanceof GeometryArray)
				{
					count += ((GeometryArray) geometry).getVertexCount();
				}
			}
		}
	}
	return count;
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:39,代码来源:ModelManager.java

示例3: isTexturesCoordinatesDefined

import javax.media.j3d.Shape3D; //导入方法依赖的package包/类
/**
 * Returns <code>true</code> if all the geometries of the given <code>shape</code> define some texture coordinates.
 */
private boolean isTexturesCoordinatesDefined(Shape3D shape)
{
	for (int i = 0, n = shape.numGeometries(); i < n; i++)
	{
		Geometry geometry = shape.getGeometry(i);
		if (geometry instanceof GeometryArray
				&& (((GeometryArray) geometry).getVertexFormat() & GeometryArray.TEXTURE_COORDINATE_2) == 0)
		{
			return false;
		}
	}
	return true;
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:17,代码来源:HomePieceOfFurniture3D.java

示例4: renderFronts

import javax.media.j3d.Shape3D; //导入方法依赖的package包/类
public static LineArray renderFronts( Shape3D shape , float scale )
{
	Geometry geom = shape.getGeometry( );
	
	if( geom instanceof IndexedGeometryArray )
	{
		return renderFronts( ( IndexedGeometryArray ) geom , scale );
	}
	else if( geom instanceof GeometryArray )
	{
		return renderFronts( ( GeometryArray ) geom , scale );
	}
	return null;
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:15,代码来源:J3DUtils.java

示例5: conversion

import javax.media.j3d.Shape3D; //导入方法依赖的package包/类
public static List<IMultiSurface<IOrientableSurface>> conversion(Group g) {

    List<IMultiSurface<IOrientableSurface>> lOS = new ArrayList<IMultiSurface<IOrientableSurface>>();

    int nbC = g.numChildren();

    for (int i = 0; i < nbC; i++) {
      Node nTemp = g.getChild(i);

      if (nTemp instanceof Shape3D) {

        Shape3D s = (Shape3D) nTemp;

        int nbGeom = s.numGeometries();

        for (int j = 0; j < nbGeom; j++) {

          Geometry geom = s.getGeometry(j);

          if (geom instanceof TriangleArray) {

            lOS.add(new GM_MultiSurface<IOrientableSurface>(
                ConversionJava3DGeOxygene
                    .fromTriangleArrayToFacettes((TriangleArray) geom)));

          } else if (geom instanceof TriangleStripArray) {

            lOS.add(new GM_MultiSurface<IOrientableSurface>(
                ConversionJava3DGeOxygene
                    .fromTriangleStripArrayToFacettes((TriangleStripArray) geom)));
          } else {

            if (geom != null) {
              System.out.println("Classe non reconnue : "
                  + geom.getClass().getName());

            }

          }
        }
      } else if (nTemp instanceof Group) {

        lOS.addAll(Format3DSToGeoxygene.conversion((Group) nTemp));

      }

    }
    // Format3DSToGeoxygene.applyRotationX(lOS);
    return lOS;

  }
 
开发者ID:IGNF,项目名称:geoxygene,代码行数:52,代码来源:Format3DSToGeoxygene.java


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