Package javax.media.j3d

Examples of javax.media.j3d.TriangleStripArray


       
        int texCoordSetMap[] = new int[1];
        texCoordSetMap[0]=0;
        int sc[]=new int [1];
        sc[0]=data.size();
        GeometryArray ga=new TriangleStripArray(data.size(),
                GeometryArray.COORDINATES |
                GeometryArray.NORMALS,
                1, texCoordSetMap,sc);
        data.fill(ga);
View Full Code Here


                  exportLine(lineStripArray, i, i + 1, verticesIndices, lineIndex);
                }
                initialIndex += stripVertexCount [strip];
              }
            } else if (geometryArray instanceof TriangleStripArray) {
              TriangleStripArray triangleStripArray = (TriangleStripArray)geometryArray;
              for (int initialIndex = 0, triangleIndex = 0, strip = 0; strip < stripVertexCount.length; strip++) {
                for (int i = initialIndex, n = initialIndex + stripVertexCount [strip] - 2, j = 0;
                     i < n; i++, j++) {
                  if (j % 2 == 0) {
                    triangleIndex = exportTriangle(triangleStripArray, i, i + 1, i + 2,
View Full Code Here

      vertexCount += lines[y].length;
      stripLenghts[y] = lines[y].length;
    }
   
    // triangle array setup
    strip = new TriangleStripArray(vertexCount,
        TriangleStripArray.COORDINATES |
        TriangleStripArray.NORMALS |
        TriangleStripArray.TEXTURE_COORDINATE_2, stripLenghts);

    strip.setName("Field" + data.getIndexX() + "/" + data.getIndexY());
View Full Code Here

      vertexcount += lines[y].length;
      striplens[y] = lines[y].length;
    }

  // triangle array setup
    TriangleStripArray strip = new TriangleStripArray(vertexcount,
        TriangleStripArray.COORDINATES |
        TriangleStripArray.NORMALS |
        TriangleStripArray.TEXTURE_COORDINATE_2, striplens);
   
    // position of the data in in the strip data space
    int strippos = 0;
   
    // copy the vertex data into the strip
    for(int y=0;y < 8;y++){
      strip.setCoordinates(strippos, lines[y]);
      strippos += lines[y].length;
     
      // generate normals
      //TODO: READ normals?
      Vector3f normals[] = CreateNormalsStripLineOfY(hf,y);
     
      // and copy them into the strip
      strip.setNormals(y * normals.length, normals);
     
      // generate texture coordinates
      TexCoord2f texcoords[] = CreateTextureCoordinatesStripLineOfY(hf,y,1f);
      strip.setTextureCoordinates(0, y * texcoords.length, texcoords);
    }
   
   
  // polygon mode
    polyAttr = new PolygonAttributes();
View Full Code Here

/* 2563 */       QuadArray qa = new QuadArray(vertexCount, vertexFormat, this.texCoordSetCount, this.texCoordSetMap);
/*      */
/* 2565 */       ga = qa;
/* 2566 */       break;
/*      */     case 4:
/* 2569 */       TriangleStripArray tsa = new TriangleStripArray(vertexCount, vertexFormat, this.texCoordSetCount, this.texCoordSetMap, this.stripCounts);
/*      */
/* 2572 */       ga = tsa;
/* 2573 */       break;
/*      */     case 3:
/* 2576 */       TriangleFanArray tfa = new TriangleFanArray(vertexCount, vertexFormat, this.texCoordSetCount, this.texCoordSetMap, this.stripCounts);
View Full Code Here

/* 284 */       tsaFlags |= 2;
/* 285 */     if ((this.flags & 0x2) != 0) {
/* 286 */       tsaFlags |= 32;
/*     */     }
/*     */
/* 289 */     obj = new TriangleStripArray(totalVerts, tsaFlags, 1, this.texCoordSetMap, stripCounts);
/*     */
/* 293 */     Point3f[] newpts = new Point3f[totalVerts];
/* 294 */     Vector3f[] newnormals = new Vector3f[totalVerts];
/* 295 */     TexCoord2f[] newtcoords = new TexCoord2f[totalVerts];
/* 296 */     int currVert = 0;
View Full Code Here

/* 188 */     int[] stripCounts = new int[3];
/* 189 */     stripCounts[0] = (2 + 2 * divisions);
/* 190 */     stripCounts[1] = divisions;
/* 191 */     stripCounts[2] = divisions;
/*     */
/* 193 */     TriangleStripArray tsa = new TriangleStripArray(vertexCount, vertexFormat, stripCounts);
/*     */
/* 197 */     tsa.setCoordinates(0, vertices);
/* 198 */     if (enableLighting) {
/* 199 */       tsa.setNormals(0, normals);
/*     */     }
/* 201 */     Appearance a = new Appearance();
/* 202 */     a.setMaterial(m);
/* 203 */     a.setCapability(0);
/* 204 */     a.setCapability(1);
View Full Code Here

/* 71 */     return createNode(j3dClass, new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE, this.texCoordSetMap.getClass(), this.stripVertexCounts.getClass() }, new Object[] { new Integer(this.vertexCount), new Integer(this.vertexFormat), new Integer(this.texCoordSetCount), this.texCoordSetMap, this.stripVertexCounts });
/*    */   }
/*    */
/*    */   protected SceneGraphObject createNode()
/*    */   {
/* 86 */     return new TriangleStripArray(this.vertexCount, this.vertexFormat, this.texCoordSetCount, this.texCoordSetMap, this.stripVertexCounts);
/*    */   }
View Full Code Here

TOP

Related Classes of javax.media.j3d.TriangleStripArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.