Package processing.core

Examples of processing.core.PVector


    else return null;
  }
 
  @Override
  public HRectangle getBoundingBox() {
    return new HRectangle(PVector.sub(PVector.add(_position, _center),new PVector(_radius,_radius)), 2*_radius, 2*_radius);
  }
 
View Full Code Here


    Hermes.getPApplet().addMouseWheelListener(this);
    //Initialize subscription list and message queue
    _keySubs = HashMultimap.create();
    _pressedKeys = new HashSet<Integer>();
    _mouseSubs = HashMultimap.create();
    _mouseLocation = new PVector(-100,-100,0);
    _mouseWheelSubs = new ArrayList<MouseWheelSubscriber>();
    _keyQueue = new LinkedList<KeyMessage>();
    _mouseQueue = new LinkedList<MouseMessage>();
    _mouseWheelQueue = new LinkedList<MouseWheelMessage>();
    if(_onOSC) {
View Full Code Here

  /**
   * Gets position of mouse as PVector
   * @return    PVector w/ x,y coordinates
   */
  public PVector getPosition() {
    return new PVector(_x, _y);
  }
View Full Code Here

    return coordWorldToPixels(world.x,world.y);
  }
 
  public PVector coordWorldToPixelsPVector(Vec2 world) {
    Vec2 v = coordWorldToPixels(world.x,world.y);
    return new PVector(v.x,v.y);
  }
View Full Code Here

    u.y *=  yFlip;
    return u;
  }
 
  public PVector vectorWorldToPixelsPVector(Vec2 v) {
    PVector u = new PVector(v.x*scaleFactor,v.y*scaleFactor);
    u.y *=  yFlip;
    return u;
  }
View Full Code Here

  public LinearProjection(float zoom, Transformation transformation) {
    super(zoom, transformation);
 
 
  public PVector rawProject(PVector point) {
    return new PVector(point.x, point.y);
  }
View Full Code Here

  public PVector rawProject(PVector point) {
    return new PVector(point.x, point.y);
  }

  public PVector rawUnproject(PVector point) {
    return new PVector(point.x, point.y);
  }
View Full Code Here

      // create
      meshModel = g.createShape();
      meshModel.beginShape(PConstants.TRIANGLE_STRIP);
      meshModel.texture(texture);
      for (int i = 0; i < vertices.size(); i++) {
        PVector vert = vertices.get(i);       
        PVector tcoord = texCoords.get(i);
        if (g.is3D()) {
          PVector norm = normals.get(i);
          meshModel.normal(norm.x, norm.y, norm.z);
          meshModel.vertex(vert.x, vert.y, vert.z, tcoord.x, tcoord.y);
        } else {
          meshModel.vertex(vert.x, vert.y, tcoord.x, tcoord.y);
        }       
      }
      meshModel.endShape();     
    } else {
      // update using setter methods
      meshModel.setTexture(texture);
      for (int i = 0; i < vertices.size(); i++) {
        PVector vert = vertices.get(i);      
        PVector tcoord = texCoords.get(i);
        if (g.is3D()) {
          PVector norm = normals.get(i);
          meshModel.setNormal(i, norm.x, norm.y, norm.z);
          meshModel.setVertex(i, vert.x, vert.y, vert.z);
        } else {
          meshModel.setVertex(i, vert.x, vert.y);         
        }              
View Full Code Here

    origGrid = new PVector[uSteps][vSteps];
    distortedGrid = new PVector[uSteps][vSteps];

    for (int u = 0; u < uSteps; u++) {
      for (int v = 0; v < vSteps; v++) {
        origGrid[u][v] = new PVector(u * meshStep, v * meshStep, 0);
        distortedGrid[u][v] = new PVector(0, 0, 0);
      }
    }
  }
View Full Code Here

      distortVertex(distortedGrid[0][v + 1].x, distortedGrid[0][v + 1].y, distortedGrid[0][v + 1].z, 0, v + 1);
    }
  }

  protected void distortVertex(float x, float y, float z, float u, float v) {
    PVector vert = vertices.get(index);
    vert.set(x, y, z);

    // texCoord stays the same

    PVector vertNorm = normals.get(index);
    PVector.div(vert, vert.mag(), vertNorm);

    index++;
  }
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.