Package nu3a.geometry

Examples of nu3a.geometry.N3Polygon


      vertexData.clear();
      normalData.clear();
      colorData.clear();
      texCoordData.clear();
      for (int i = 0; i < geometry.polygonCount(); i++) {
        N3Polygon p = geometry.getPolygon(i);
        boolean pass = false;
        for (int j = 0; j < p.getSides();) {
          if (!pass) {
            p1 = p.getVertex(j);
            p2 = p.getVertex(j + 1);
            p3 = p.getVertex(j + 2);
            n1 = p.getNormal(j);
            n2 = p.getNormal(j + 1);
            n3 = p.getNormal(j + 2);
            c1 = p.getColor(j);
            c2 = p.getColor(j + 1);
            c3 = p.getColor(j + 2);
            if (p.isTextured()) {
              uv1 = p.getUV(j);
              uv2 = p.getUV(j + 1);
              uv3 = p.getUV(j + 2);
            }
            j += 3;
            pass = true;
          } else {
            p2 = p3;
            c2 = c3;
            n2 = n3;
            uv2 = uv3;
            p3 = p.getVertex(j);
            n3 = p.getNormal(j);
            c3 = p.getColor(j);
            if (p.isTextured())
              uv3 = p.getUV(j);
            j++;
          }
          vertexData.addVertex(p1);
          colorData.addColor(c1);
          normalData.addNormal(n1);
          vertexData.addVertex(p2);
          colorData.addColor(c2);
          normalData.addNormal(n2);
          vertexData.addVertex(p3);
          colorData.addColor(c3);
          normalData.addNormal(n3);
          if (p.isTextured()) {
            texCoordData.addTexCoord(uv1);
            texCoordData.addTexCoord(uv2);
            texCoordData.addTexCoord(uv3);
          }
        }
View Full Code Here


    boolean first = true;

    // Calculamos la caja AABB a partir de la geometria

    for (int i = 0; i < geometryData.polygonCount(); i++) {
      N3Polygon poly = geometryData.getPolygon(i);
      for (int j = 0; j < poly.getSides(); j++) {
        N3Point3D vertex = (N3Point3D) poly.getVertex(j);
        N3Point3D v = new N3Point3D(vertex.x, vertex.y, vertex.z);
        v = m.mult(v);
        if (first) {
          maxX = minX = v.x;
          maxY = minY = v.y;
View Full Code Here

      N3ColorRGBA c2 = null;
      vertexData.clear();
      normalData.clear();
      colorData.clear();
      for (int i = 0; i < geometry.polygonCount(); i++) {
        N3Polygon p = geometry.getPolygon(i);
        boolean pass = false;
        for (int j = 0; j < p.getSides();) {
          if (!pass) {
            p1 = p.getVertex(j);
            p2 = p.getVertex(j + 1);
            n1 = p.getNormal(j);
            n2 = p.getNormal(j + 1);
            c1 = p.getColor(j);
            c2 = p.getColor(j + 1);
            j += 2;
            pass = true;
          } else {
            p1 = p2;
            c1 = c2;
            n1 = n2;
            p2 = p.getVertex(j);
            n2 = p.getNormal(j);
            c2 = p.getColor(j);
            j++;
          }
          vertexData.addVertex(p1);
          colorData.addColor(c1);
          normalData.addNormal(n1);
View Full Code Here

      N3ColorRGBA c1 = null;
      vertexData.clear();
      normalData.clear();
      colorData.clear();
      for (int i = 0; i < geometry.polygonCount(); i++) {
        N3Polygon p = geometry.getPolygon(i);
        boolean pass = false;
        for (int j = 0; j < p.getSides(); j++) {
          p1 = p.getVertex(j);
          n1 = p.getNormal(j);
          c1 = p.getColor(j);
          vertexData.addVertex(p1);
          colorData.addColor(c1);
          normalData.addNormal(n1);
        }
      }
View Full Code Here

TOP

Related Classes of nu3a.geometry.N3Polygon

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.