Package processing.core

Examples of processing.core.PVector


  /**
   * Adds vertex, texture coordinates, and normals.
   */
  protected void addVertex(float x, float y, float z, float u, float v) {
    PVector vert = new PVector(x, y, z);
    PVector texCoord = new PVector(u / (uSteps - 1), v / (vSteps - 1));
    PVector vertNorm = PVector.div(vert, vert.mag());
    vertices.add(vert);
    texCoords.add(texCoord);
    normals.add(vertNorm);
  }
View Full Code Here


  @Override
  public void executeManipulationFor(UnfoldingMap map) {
    if (transformationCenterLocation != null) {
      ScreenPosition pos = map.mapDisplay.getScreenPosition(transformationCenterLocation);
      PVector transCenter = new PVector(pos.x, pos.y);
      map.mapDisplay.setInnerTransformationCenter(transCenter);
    }

    if (ZOOM_BY_LEVEL.equals(getSubType())) {
      map.zoomLevel(zoomLevelDelta);
View Full Code Here

    this.by = by;
    this.cy = cy;
  }

  public PVector transform(PVector point) {
    return new PVector((float) (ax * point.x + bx * point.y + cx), (float) (ay * point.x + by * point.y + cy));
  }
View Full Code Here

  public PVector transform(PVector point) {
    return new PVector((float) (ax * point.x + bx * point.y + cx), (float) (ay * point.x + by * point.y + cy));
  }

  public PVector untransform(PVector point) {
    return new PVector((float) ((point.x * by - point.y * bx - cx * by + cy * bx) / (ax * by - ay * bx)),
        (float) ((point.x * ay - point.y * ax - cx * ay + cy * ax) / (bx * ay - by * ax)));
  }
 
View Full Code Here

  public MercatorProjection(float zoom, Transformation transformation) {
    super(zoom, transformation);
 
 
  public PVector rawProject(PVector point) {
    return new PVector(point.x, PApplet.log(PApplet.tan(0.25f * PApplet.PI + 0.5f * point.y)));
  }
View Full Code Here

  public PVector rawProject(PVector point) {
    return new PVector(point.x, PApplet.log(PApplet.tan(0.25f * PApplet.PI + 0.5f * point.y)));
  }

  public PVector rawUnproject(PVector point) {
    return new PVector(point.x, 2.0f * PApplet.atan(PApplet.pow((float)Math.E, point.y)) - 0.5f * PApplet.PI);
  }
View Full Code Here

    pg.popStyle();
  }

  @Override
  public boolean isInside(float checkX, float checkY, float x, float y) {
    PVector pos = new PVector(x, y);
    return pos.dist(new PVector(checkX, checkY)) < radius; // FIXME must be zoom dependent
  }
View Full Code Here

    float[] yAvgValues = computeMovingAverage(yValues, np);

    // Combine averaged x and y back to vertices
    List<PVector> averageVertices = new ArrayList<PVector>();
    for (int i = 0; i < xAvgValues.length; i++) {
      averageVertices.add(new PVector(xAvgValues[i], yAvgValues[i]));
    }

    return averageVertices;
  }
View Full Code Here

   */
  protected static List<PVector> simplifyRadialDistance(List<PVector> points, float sqTolerance) {

    int i;
    float len = points.size();
    PVector point = null;
    PVector prevPoint = points.get(0);
    List<PVector> newPoints = new ArrayList<PVector>();
    newPoints.add(prevPoint);

    for (i = 1; i < len; i++) {
      point = points.get(i);
View Full Code Here

    this.provider = provider;

    this.width = width;
    this.height = height;

    transformationCenter = new PVector(width / 2, height / 2);
    innerTransformationCenter = new PVector(width / 2, height / 2);

    innerScale = (float) Math.ceil(Math.min(height / (float) TILE_WIDTH, width / (float) TILE_HEIGHT));

    markerManagerList = new ArrayList<MarkerManager<Marker>>();
  }
View Full Code Here

TOP

Related Classes of processing.core.PVector

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.