Package nu3a.math

Examples of nu3a.math.N3Matrix4D


   *            Nombre del nodo
   */
  public N3TransformationNode(N3Scene scene, String name)
      throws N3NameException {
    super(scene, name);
    matrix = new N3Matrix4D();
    tmpAccMatrix = new N3Matrix4D();
    lastMatrix = new N3Matrix4D();
    translation = new N3Vector3D(0, 0, 0);
    scale = new N3Vector3D(1.0f, 1.0f, 1.0f);
    angle = 0;
    rotation = new N3Vector3D(1.0f, 1.0f, 1.0f);
    needTranslation = needScale = needRotation = false;
View Full Code Here


   */
  public void update() {
    if (needScale || needRotation || needTranslation) {
      lastMatrix.setData(matrix);
      if (needScale) {
        N3Matrix4D scaleMatrix = new N3Matrix4D();
        scaleMatrix.scale(scale);
        matrix.mult(scaleMatrix);
        needScale = false;
      }
      if (needRotation) {
        N3Matrix4D rotationMatrix = new N3Matrix4D();
        rotationMatrix.rotate(angle, rotation);
        matrix.mult(rotationMatrix);
        needRotation = false;
      }
      if (needTranslation) {
        N3Matrix4D translationMatrix = new N3Matrix4D();
        translationMatrix.translate(translation);
        matrix.mult(translationMatrix);
        needTranslation = false;
      }
      setDirty();
    }
View Full Code Here

   * @return Matriz acumulada de transformaciones
   */
  public N3Matrix4D getAccMatrix() {
    if (isDirty) {
      if (parent == null) {
        accMatrix = new N3Matrix4D();
      } else {
        accMatrix = parent.getAccMatrix();
      }
      isDirty = false;
    }
View Full Code Here

  public N3Render(Component renderComponent, boolean doubleBuffer)
      throws N3CreateRenderException {
    if (renderComponent.isVisible()) {
      this.doubleBuffer = doubleBuffer;
      this.renderComponent = renderComponent;
      initialTransform = new N3Matrix4D();
      tempMatrix = new N3Matrix4D();
    } else
      throw (new N3CreateRenderException(
          "Render component is not visible. Make it visible before create N3Render"));
  }
View Full Code Here

    super(renderComponent, doubleBuffer);
    define_const();
    renderContext = new N3SoftwareRenderContext(renderComponent,
        doubleBuffer);

    projectionMatrix = new N3Matrix4D();
    modelViewMatrix = new N3Matrix4D();
    cullFace = N3Render.N3_BACK_CULL;
    clearColor = new N3ColorRGBA(0, 0, 0);
    lights = new N3SoftwareLight[MAX_LIGHTS];
    for (int i = 0; i < lights.length; i++)
      lights[i] = new N3SoftwareLight();
View Full Code Here

      N3Scene scene, String name) throws N3InvalidCameraValuesException,
      N3NameException {
    super(scene, name);
    internalCamera = new N3CameraData(v, a, wh, zN, zF);
    target = null;
    matrix = new N3Matrix4D();
    targetMatrix = new N3Matrix4D();
    inverseTransform = new N3Matrix4D();
    internalCamera.addCamera(this);
    scene.addCamera(this);
  }
View Full Code Here

  public N3Camera(N3CameraData data, N3Scene scene, String name)
      throws N3InvalidCameraValuesException, N3NameException {
    super(scene, name);
    internalCamera = data;
    target = null;
    matrix = new N3Matrix4D();
    targetMatrix = new N3Matrix4D();
    inverseTransform = new N3Matrix4D();
    internalCamera.addCamera(this);
    scene.addCamera(this);
  }
View Full Code Here

   * @return Matriz acumulada de transformaciones
   */
  public N3Matrix4D getAccMatrix() {
    super.getAccMatrix();
    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

TOP

Related Classes of nu3a.math.N3Matrix4D

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.