Package com.sun.j3d.utils.geometry

Examples of com.sun.j3d.utils.geometry.NormalGenerator


        Debug.message("3detail", "OMGraphicUtil: begin triangulation");
        tr.triangulate(gi);
        Debug.message("3detail", "OMGraphicUtil: end triangulation");
        gi.recomputeIndices();

        NormalGenerator ng = new NormalGenerator();
        ng.generateNormals(gi);
        gi.recomputeIndices();

        Stripifier st = new Stripifier();
        st.stripify(gi);
        gi.recomputeIndices();
View Full Code Here


    double[] coords = new double[data[0].length*3];
    nioCoords.position(0);
    nioCoords.get(coords);
    gi.setCoordinates(coords);
        // generate normals
        NormalGenerator ng = new NormalGenerator();
        ng.generateNormals(gi);
        Vector3f[] n3f = gi.getNormals();
        int[] ni = gi.getNormalIndices();
        float[] tmp = new float[3];
    for (int i=0; i<ni.length; ++i) {
      n3f[ni[i]].get(tmp);
View Full Code Here

        GeometryInfo gi=new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
        gi.setCoordinates(values);
        int sc[]=new int [1];
        sc[0]=values.length/3;
        gi.setStripCounts(sc);
        NormalGenerator ng = new NormalGenerator();
        ng.generateNormals(gi);
        Stripifier st = new Stripifier();
        st.stripify(gi);
        GeometryArray result = gi.getGeometryArray();
        return result;
    }
View Full Code Here

                destIndex += faceNormalIndices.length;
              }
              geometryInfo.setNormals(normals);
              geometryInfo.setNormalIndices(normalIndices);
            } else {
              NormalGenerator normalGenerator = new NormalGenerator(Math.PI / 2);
              if (!group.isSmooth()) {
                normalGenerator.setCreaseAngle(0);
              }
              normalGenerator.generateNormals(geometryInfo);
            }
            geometryArray = geometryInfo.getGeometryArray(true, true, false);
          } else { // Line
            int format = IndexedGeometryArray.COORDINATES;
            if (firstGeometryHasTextureCoordinateIndices) {
View Full Code Here

      geometryInfo.setTextureCoordinateParams(1, 2);
      geometryInfo.setTextureCoordinates(0, textureCoords);
    }
   
    // Generate normals
    NormalGenerator normalGenerator = new NormalGenerator();
    if (arcCircleCenter == null) {
      normalGenerator.setCreaseAngle(0);
    }
    normalGenerator.generateNormals(geometryInfo);
    return geometryInfo.getIndexedGeometryArray();
  }
View Full Code Here

    geometryInfo.setStripCounts(new int [] {coords.length});
    if (reverseOrder) {
      geometryInfo.reverse();
    }
    // Generate normals
    NormalGenerator normalGenerator = new NormalGenerator();
    if (roundWall) {
      normalGenerator.setCreaseAngle(0);
    }
    normalGenerator.generateNormals(geometryInfo);
    return geometryInfo.getIndexedGeometryArray ();
  }
View Full Code Here

    }
    GeometryInfo geometryInfo = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
    geometryInfo.setCoordinates (coords);
    geometryInfo.setStripCounts(new int [] {coords.length});
    // Generate normals
    NormalGenerator normalGenerator = new NormalGenerator();
    if (roundWall) {
      normalGenerator.setCreaseAngle(0);
    }
    normalGenerator.generateNormals(geometryInfo);
    return geometryInfo.getIndexedGeometryArray ();
  }
View Full Code Here

        geometryInfo.setStripCounts(stripCounts);
        geometryInfo.setContourCounts(contourCounts);
      }

      if (this.geometryNormals == null) {
        new NormalGenerator(Math.PI / 2).generateNormals(geometryInfo);
      }
      return geometryInfo.getGeometryArray(true, true, false);
    }
View Full Code Here

          geometryInfo.setTextureCoordinateParams(1, 2);
          geometryInfo.setTextureCoordinates(0, textureCoords);
        }
       
        // Generate normals
        new NormalGenerator(0).generateNormals(geometryInfo);
        geometries [i] = geometryInfo.getIndexedGeometryArray();
      }
      return geometries;
    } else {
      return new Geometry [0];
View Full Code Here

      Point3f q1 = new Point3f(), q2 = new Point3f(), q3 = new Point3f();
      Vector3f n1 = new Vector3f(), n2 = new Vector3f();
      numPoints = 0;
      //Now loop thru each island, calling triangulator once per island.
      //Combine triangle data for all islands together in one object.
    NormalGenerator ng = new NormalGenerator();
    for (i = 0; i < islandCounts.length; i++) {
      contourCounts[0] = islandCounts[i].length;
      numPoints += outVerts[i].length;
      GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
      gi.setCoordinates(outVerts[i]);
      gi.setStripCounts(islandCounts[i]);
      gi.setContourCounts(contourCounts);
      ng.generateNormals(gi);

      GeometryArray ga = gi.getGeometryArray(false, false, false);
      vertOffset += ga.getVertexCount();

      triangData.add(ga);
View Full Code Here

TOP

Related Classes of com.sun.j3d.utils.geometry.NormalGenerator

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.