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


Java LineStripArray.setCoordinates方法代码示例

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


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

示例1: PolyLine

import javax.media.j3d.LineStripArray; //导入方法依赖的package包/类
/** Create polyline.
  * @param points      array of <code>Point3D</code>s
  * @param appearance  object' Appearance 
  * @preconditions points.length > 1 */
public PolyLine(Point3d[] points,
                Appearance appearance) {
           
  if (points.length < 2) {
    return;
    }
         
  int[] counts = new int[1];
  counts[0] = points.length;
  LineStripArray lineArray = new LineStripArray(points.length, 
                                                GeometryArray.COORDINATES|
                                                GeometryArray.NORMALS,
                                                counts);
  float[] normal = {0, 0, 0};
  lineArray.setCoordinates(0, points);
  lineArray.setNormal(0, normal);
  setGeometry(lineArray);        
  setAppearance(appearance);
    
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:25,代码来源:PolyLine.java

示例2: setupFinished

import javax.media.j3d.LineStripArray; //导入方法依赖的package包/类
/**
 * Notification that the construction phase of this node has finished.
 * If the node would like to do any internal processing, such as setting
 * up geometry, then go for it now.
 */
public void setupFinished() {
    if(!inSetup)
        return;

    super.setupFinished();

    int num_points = numLineSegments / 2;
    float[] coords = new float[num_points * 3];
    for(int i = 0; i < num_points; i++) {
        coords[i * 3] = vfLineSegments[i * 2];
        coords[i * 3 + 1] = vfLineSegments[i * 2 + 1];
        coords[i * 3 + 2] = 0;
    }

    implGeom = new LineStripArray(num_points,
                                  LineStripArray.COORDINATES,
                                  new int[] { num_points });
    implGeom.setCoordinates(0, coords);
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:25,代码来源:J3DPolyline2D.java

示例3: toLineGeometry

import javax.media.j3d.LineStripArray; //导入方法依赖的package包/类
/**
      * @return GeometryArray
      */
     public GeometryArray toLineGeometry() {
         LineStripArray a = new LineStripArray(size(),
             GeometryArray.COORDINATES, new int[] { size() });
a.setCoordinates(0, toArray(new Point3d[] {}));
return a;
     }
 
开发者ID:tsandmann,项目名称:ct-sim,代码行数:10,代码来源:CtBotShape.java

示例4: generateGeometry

import javax.media.j3d.LineStripArray; //导入方法依赖的package包/类
/**
 * Convenience method to generate new geometry.
 */
private void generateGeometry() {
    maxVertexCount = geometryData.vertexCount;

    int format = LineStripArray.COORDINATES;

    impl = new LineStripArray(geometryData.vertexCount,
                              format,
                              1,
                              TEX_SET_MAP,
                              geometryData.stripCounts);

    impl.setCapability(LineStripArray.ALLOW_COUNT_WRITE);
    impl.setCapability(LineStripArray.ALLOW_COORDINATE_WRITE);

    impl.setCoordinates(0, geometryData.coordinates);

    J3DUserData u_data = new J3DUserData();
    u_data.geometryData = geometryData;

    impl.setUserData(u_data);

    if(capReqdBits != null) {
        for(int i = 0; i < capReqdBits.length; i++)
            impl.setCapability(capReqdBits[i]);
    }

    if(J3DGlobalStatus.haveFreqBitsAPI && freqReqdBits != null) {
        for(int i = 0; i < freqReqdBits.length; i++)
            impl.setCapabilityIsFrequent(freqReqdBits[i]);
    }
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:35,代码来源:J3DNurbsCurve.java

示例5: outputShape

import javax.media.j3d.LineStripArray; //导入方法依赖的package包/类
private void outputShape(OrderedGroup triGroup, int orderDir, TexCoordGeneration tg, Texture2D texture, int numPts, Point3d[] pts, Color4f[] colrs)
{

	count[0] = numPts;
	TriangleFanArray pgonGeo = new TriangleFanArray(numPts,
			GeometryArray.COORDINATES | GeometryArray.COLOR_4, count);
	pgonGeo.setCoordinates(0, pts, 0, numPts);
	pgonGeo.setColors(0, colrs, 0, numPts);

	Appearance appearance = new Appearance();
	if (texture != null)
	{
		appearance.setTextureAttributes(texAttr);
		appearance.setTexture(texture);
	}
	appearance.setMaterial(m);
	appearance.setColoringAttributes(clr);
	appearance.setTransparencyAttributes(trans);
	appearance.setPolygonAttributes(p);
	appearance.setTexCoordGeneration(tg);
	appearance.setRenderingAttributes(r);
	Shape3D shape = new Shape3D(pgonGeo, appearance);

	Node child = shape;

	if (outputLines)
	{
		Group shapeGroup = new Group();
		shapeGroup.addChild(shape);
		count[0] = numPts + 1;
		pts[numPts] = pts[0];
		LineStripArray lineGeo = new LineStripArray(numPts + 1,
				GeometryArray.COORDINATES, count);
		lineGeo.setCoordinates(0, pts, 0, numPts + 1);
		Appearance lineAppearance = new Appearance();
		Shape3D lineShape = new Shape3D(lineGeo, lineAppearance);
		shapeGroup.addChild(lineShape);
		child = shapeGroup;
	}

	if (verbose)
	{
		System.out.println("shape is " + child);
	}

	if (orderDir == FRONT)
	{
		triGroup.insertChild(child, 0);
	} else
	{
		triGroup.addChild(child);
	}
}
 
开发者ID:TOMIGalway,项目名称:cmoct-sourcecode,代码行数:54,代码来源:SlicePlane2DRenderer.java


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