本文整理汇总了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 );
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}