Package nu3a.math

Examples of nu3a.math.N3Vector3D


    index = Integer.parseInt(data.getAttribute("index"));
    N3ColorRGBA specular = (N3ColorRGBA) reader.getResource(index, nodes);

    data = (Element) infoNode.getElementsByTagName("direction").item(0);
    index = Integer.parseInt(data.getAttribute("index"));
    N3Vector3D direction = (N3Vector3D) reader.getResource(index, nodes);

    data = (Element) infoNode.getElementsByTagName("positional").item(0);
    boolean positional = (new Boolean(data.getAttribute("value")))
        .booleanValue();
View Full Code Here


      matSpecular = new N3ColorRGBA(0, 0, 0);
    }
    ambiental = new N3ColorRGBA(0.2f, 0.2f, 0.2f);
    diffuse = new N3ColorRGBA(0.8f, 0.8f, 0.8f);
    specular = new N3ColorRGBA(0, 0, 0, 0);
    dir = new N3Vector3D();
    pos = new N3Point3D();
    enable = true;
    d = new N3Vector3D();
    ambientTerm = new N3ColorRGBA();
    diffuseTerm = new N3ColorRGBA();
    specularTerm = new N3ColorRGBA();
  }
View Full Code Here

   * la posici�n del nodo objetivo, y el vector que indica d�nde se encuentra
   * la parte superior de la escena.
   */
  protected void cameraLookAt(N3Vector3D eye, N3Vector3D center,
      N3Vector3D top) {
    N3Vector3D x, y, z;
    float[] m;

    z = new N3Vector3D(eye.x - center.x, eye.y - center.y, eye.z - center.z);
    z.normalize();

    y = new N3Vector3D(top.x, top.y, top.z);
    x = N3Vector3D.crossProduct(y, z);
    y = N3Vector3D.crossProduct(z, x);

    x.normalize();
    y.normalize();

    m = targetMatrix.getMatrix();

    m[0] = x.x;
View Full Code Here

    if (target != null) {
      N3Matrix4D targetM = target.getAccMatrix();
      float[] tmpMatrix = accMatrix.getMatrix();
      // Las coordenadas de posici�n est�n abajo, no en la derecha...
      // mierda de traspuestas...
      N3Vector3D eye = new N3Vector3D(tmpMatrix[12], tmpMatrix[13],
          tmpMatrix[14]);
      tmpMatrix = targetM.getMatrix();
      N3Vector3D center = new N3Vector3D(tmpMatrix[12], tmpMatrix[13],
          tmpMatrix[14]);
      targetMatrix.identity();
      cameraLookAt(eye, center, top);
      accMatrix = targetMatrix;
    }
View Full Code Here

      String name = ((Element) info.getElementsByTagName("targetname")
          .item(0)).getAttribute("value");
      N3Node target = (N3Node) manager.getNamedObject(name);
      int index = Integer.parseInt(((Element) info.getElementsByTagName(
          "top").item(0)).getAttribute("index"));
      N3Vector3D top = (N3Vector3D) resources.resourceAt(index);
      setTarget(target, top);
    }
  }
View Full Code Here

    }

    public int compare(Object o1, Object o2) {
      N3Point3D node1Pos = ((N3Node) o1).getPosition();
      N3Point3D node2Pos = ((N3Node) o2).getPosition();
      N3Vector3D node1Vector = new N3Vector3D(node1Pos.x - p.x,
          node1Pos.y - p.y, node1Pos.z - p.z);
      N3Vector3D node2Vector = new N3Vector3D(node2Pos.x - p.x,
          node2Pos.y - p.y, node2Pos.z - p.z);
      float node1Dist = node1Vector.length();
      float node2Dist = node2Vector.length();
      if (node1Dist < node2Dist)
        return -1;
      if (node1Dist > node2Dist)
        return 1;
      return 0;
View Full Code Here

TOP

Related Classes of nu3a.math.N3Vector3D

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.