Package nu3a.material

Examples of nu3a.material.N3Material


        .booleanValue());

    data = (Element) infoNode.getElementsByTagName("material").item(0);
    index = Integer.parseInt(data.getAttribute("index"));
    if (index != -1) {
      N3Material m = (N3Material) resources.resourceAt(index);
      result.setMaterial(m);
    }

    return result;
  }
View Full Code Here


        .booleanValue());

    data = (Element) infoNode.getElementsByTagName("material").item(0);
    index = Integer.parseInt(data.getAttribute("index"));
    if (index != -1) {
      N3Material m = (N3Material) resources.resourceAt(index);
      result.setMaterial(m);
    }

    return result;
  }
View Full Code Here

        .booleanValue());

    data = (Element) infoNode.getElementsByTagName("material").item(0);
    index = Integer.parseInt(data.getAttribute("index"));
    if (index != -1) {
      N3Material m = (N3Material) resources.resourceAt(index);
      result.setMaterial(m);
    }

    return result;
  }
View Full Code Here

    this.getContentPane().add(c);
    setVisible(true);
  }

  void loadMaterials() throws Exception {
    material = new N3Material(scene, "mat1");

    InputStream is = new FileInputStream("files/nu3a.png");

    N3JDKImageLoader loader = new N3JDKImageLoader(is);
    N3Texture2D texture = new N3Texture2D(scene, "textura1");
View Full Code Here

    N3TransformationNode sueloRot = new N3TransformationNode(scene, "sueloRot");
    N3TransformationNode sueloTrans;
    sueloRot.rotate(-90.0f, new N3Vector3D(1.0f, 0, 0));
    sueloRot.update();
    N3GeometryData g = N3GeometryData.createPlane(0.4f, 0.4f, new N3ColorRGBA(1, 0, 0), false);
    N3Material sm = new N3Material(scene, "rojo");
    sm.setAmbientColor(new N3ColorRGBA(1, 0, 0));
    sm.setSpecularColor(new N3ColorRGBA(0, 0, 0), 0.1f);
    sm.setDiffuseColor(new N3ColorRGBA(1, 0, 0));
    sm.applyMaterial(true);
    for (int i = -5; i < 4; i++)
      for (int j = -5; j < 4; j++) {
        sueloTrans = new N3TransformationNode(scene, "sueloTrans" + i + "-" + j);
        sueloTrans.translate(new N3Vector3D(i * 0.4f, j * 0.4f, 0));
        sueloTrans.update();
        suelo = new N3VisualMesh(scene, g, "suelo" + i + "-" + j);
        suelo.setMaterial(sm);
        sueloTrans.addChild(suelo);
        sueloRot.addChild(sueloTrans);
      }

    cubeTrans = new N3TransformationNode(scene, "cubeTrans");
    cubeTrans.translate(new N3Vector3D(0, 0.2f, 1.0f));
    cubeTrans.update();

    // El otro cubo
    N3TransformationNode cubeTrans2 = new N3TransformationNode(scene, "cubeTrans2");
    cubeTrans2.translate(new N3Vector3D(-0.5f, 0.2f, -0.5f));
    cubeTrans2.update();

    cube = new N3VisualMesh(scene, N3GeometryData.createCube(0.4f, 0.4f, 0.4f, new N3ColorRGBA(1, 1, 1), true), "cube");
    cube.setMaterial(material);

    // El otro cubo
    cube2 = new N3VisualMesh(scene, N3GeometryData.createCube(0.4f, 0.4f, 0.4f, new N3ColorRGBA(1, 1, 1), true), "cube2");
    cube2.setMaterial(material);

    sphereTrans = new N3TransformationNode(scene, "sphereTrans");
    sphereTrans.translate(new N3Vector3D(0.5f, 0.5f, 0.0f));
    sphereTrans.update();

    sphere = new N3VisualMesh(scene, N3GeometryData.createSphere(20, 20, 0.15f, new N3ColorRGBA(0, 0, 1)), "sphere");
    sphere.setMaterial(new N3Material(scene, "Azul"));
    sphere.getMaterial().setAmbientColor(new N3ColorRGBA(0, 0, 1));
    sphere.getMaterial().setSpecularColor(new N3ColorRGBA(0, 0, 0), 0.1f);
    sphere.getMaterial().setDiffuseColor(new N3ColorRGBA(0, 0, 1));
    sphere.getMaterial().applyMaterial(true);

View Full Code Here

TOP

Related Classes of nu3a.material.N3Material

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.