Package org.osm2world.core.target.common.material

Examples of org.osm2world.core.target.common.material.Material


   * @return  a material based on the input, possibly with added turn arrows
   */
  private static Material addTurnArrows(Material material,
      TagGroup laneTags) {
   
    Material arrowMaterial = null;
   
    /* find the right material  */
   
    String turn = laneTags.getValue("turn");
   
    if (turn != null) {
     
      if (turn.contains("through") && turn.contains("right")) {
       
        arrowMaterial = ROAD_MARKING_ARROW_THROUGH_RIGHT;
       
      } else if (turn.contains("through") && turn.contains("left")) {
       
        arrowMaterial = ROAD_MARKING_ARROW_THROUGH_RIGHT;
       
      } else if (turn.contains("through")) {
       
        arrowMaterial = ROAD_MARKING_ARROW_THROUGH;
       
      } else if (turn.contains("right") && turn.contains("left")) {
       
        arrowMaterial = ROAD_MARKING_ARROW_RIGHT_LEFT;
       
      } else if (turn.contains("right")) {
       
        arrowMaterial = ROAD_MARKING_ARROW_RIGHT;
       
      } else if (turn.contains("left")) {
       
        arrowMaterial = ROAD_MARKING_ARROW_RIGHT;
       
      }
     
    }
   
    /* apply the results */
   
    if (arrowMaterial != null) {
      material = material.withAddedLayers(arrowMaterial.getTextureDataList());
    }
   
    return material;
   
  }
View Full Code Here


    }
   
    @Override
    public void renderTo(Target<?> target) {
     
      Material material = getSurfaceForNode(node);
      Collection<TriangleXYZ> triangles = super.getTriangulation();
     
      target.drawTriangles(material, triangles,
          triangleTexCoordLists(triangles, material, GLOBAL_X_Z));
     
View Full Code Here

     
      /* render area not covered by connections */
     
      //TODO: subtract area covered by connections
     
      Material material = getSurfaceForNode(node);
     
      Collection<TriangleXYZ> trianglesXYZ = getTriangulation();
     
      target.drawTriangles(material, trianglesXYZ,
          triangleTexCoordLists(trianglesXYZ, material, GLOBAL_X_Z));
View Full Code Here

      VectorXYZ endRight = getEleConnectors().getPosXYZ(
          endPos.add(cutVector.mult(0.5 * endWidth)));
     
      /* determine surface material */
     
      Material surface = getSurfaceForNode(node);
     
      if (node.getTags().contains("crossing", "zebra")
          || node.getTags().contains("crossing_ref", "zebra")) {
       
        surface = surface.withAddedLayers(
            ROAD_MARKING_ZEBRA.getTextureDataList());
       
      } else if (!node.getTags().contains("crossing", "unmarked")) {

        surface = surface.withAddedLayers(
            ROAD_MARKING_CROSSING.getTextureDataList());
       
      }
     
      /* draw crossing */
 
View Full Code Here

   
    @Override
    public void renderTo(Target<?> target) {
     
      String surface = area.getTags().getValue("surface");
      Material material = getSurfaceMaterial(surface, ASPHALT);
      Collection<TriangleXYZ> triangles = getTriangulation();
     
      target.drawTriangles(material, triangles,
          triangleTexCoordLists(triangles, material, GLOBAL_X_Z));
     
View Full Code Here

        boolean rightHandTraffic,
        TagGroup roadTags, TagGroup laneTags,
        List<VectorXYZ> leftLaneBorder,
        List<VectorXYZ> rightLaneBorder) {
     
      Material surface = getSurface(roadTags, laneTags);
      Material surfaceMiddle = getSurfaceMiddle(roadTags, laneTags);
           
      /* draw lane triangle strips */
     
      if (surfaceMiddle == null || surfaceMiddle.equals(surface)) {
       
        List<VectorXYZ> vs = createTriangleStripBetween(
            leftLaneBorder, rightLaneBorder);
       
        boolean mirrorLeftRight = laneTags.containsKey("turn")
View Full Code Here

   
    /* render transparent primitives back-to-front */
   
    sortPrimitivesBackToFront(camera, projection);
   
    Material previousMaterial = null;
   
    for (PrimitiveWithMaterial p : transparentPrimitives) {
     
      if (!p.material.equals(previousMaterial)) {
        JOGLTarget.setMaterial(gl, p.material, textureManager);
View Full Code Here

   
    /* render transparent primitives back-to-front */

    sortPrimitivesBackToFront(camera, projection);
   
    Material previousMaterial = null;
   
    for (PrimitiveWithMaterial p : transparentPrimitives) {
     
      if (!p.material.equals(previousMaterial)) {
        JOGLTarget.setMaterial(gl, p.material, textureManager);
View Full Code Here

           
      float width = parseWidth(node.getTags(), 1.5f);
     
      /* determine material */
     
      Material material = null;
     
      //TODO parse color
     
      if (material == null) {
        material = Materials.getSurfaceMaterial(
View Full Code Here

     
      double thickness = min(height, width) / 8;
     
      /* determine material and direction */
     
      Material material = null;
     
      //TODO parse color
     
      if (material == null) {
        material = Materials.getSurfaceMaterial(
View Full Code Here

TOP

Related Classes of org.osm2world.core.target.common.material.Material

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.