Package org.osm2world.core.target.common.rendering

Examples of org.osm2world.core.target.common.rendering.Projection


    ImageExporter exporter = null;
   
    for (CLIArguments args : argumentsGroup.getCLIArgumentsList()) {
     
      Camera camera = null;
      Projection projection = null;
     
      if (args.isOviewTiles()) {
       
        camera = OrthoTilesUtil.cameraForTiles(
            results.getMapProjection(),
            args.getOviewTiles(),
            args.getOviewAngle(),
            args.getOviewFrom());
        projection = OrthoTilesUtil.projectionForTiles(
            results.getMapProjection(),
            args.getOviewTiles(),
            args.getOviewAngle(),
            args.getOviewFrom());
       
      } else if (args.isOviewBoundingBox()) {
       
        double angle = args.getOviewAngle();
        CardinalDirection from = args.getOviewFrom();
       
        Collection<VectorXZ> pointsXZ = new ArrayList<VectorXZ>();
        for (LatLonEle l : args.getOviewBoundingBox()) {
          pointsXZ.add(results.getMapProjection().calcPos(l.lat, l.lon));
        }
        AxisAlignedBoundingBoxXZ bounds =
          new AxisAlignedBoundingBoxXZ(pointsXZ);
             
        camera = OrthoTilesUtil.cameraForBounds(bounds, angle, from);
        projection = OrthoTilesUtil.projectionForBounds(bounds, angle, from);
       
      } else if (args.isPviewPos()) {
       
        MapProjection proj = results.getMapProjection();
       
        LatLonEle pos = args.getPviewPos();
        LatLonEle lookAt = args.getPviewLookat();
       
        camera = new Camera();
        VectorXYZ posV = proj.calcPos(pos.lat, pos.lon).xyz(pos.ele);
        VectorXYZ laV =  proj.calcPos(lookAt.lat, lookAt.lon).xyz(lookAt.ele);
        camera.setCamera(posV.x, posV.y, posV.z, laV.x, laV.y, laV.z);
       
        projection = new Projection(false,
            args.isPviewAspect() ? args.getPviewAspect() :
              (double)args.getResolution().x / args.getResolution().y,
              args.getPviewFovy(),
            0,
            1, 50000);
View Full Code Here

TOP

Related Classes of org.osm2world.core.target.common.rendering.Projection

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.