Package gml4u.model

Examples of gml4u.model.GmlPoint.distanceTo()


      if (prev.isZeroVector()) {
        prev.set(point);
      }
      pos.set(point);
      // use distance to previous point as target stroke weight
      weight += (Math.sqrt(pos.distanceTo(prev))*2-weight)*0.1;

      /*weight = 0;
      if(pos.time- prev.time != 0) {
        weight = pos.distanceTo(prev);
      }*/
 
View Full Code Here


       
        // Check minimum distance from last point
        if (null != strokes.get(sessionID).getLastPoint()) {
          GmlPoint prev = new GmlPoint();
          prev.set(strokes.get(sessionID).getLastPoint());
          if (prev.distanceTo(v) > minPointsDistance) {
            strokes.get(sessionID).addPoint(new GmlPoint(v, time, pressure, rotation, direction, thickness));
          }
          else {
            LOGGER.log(Level.FINE, "Skipped, too close from previous point: "+prev.distanceTo(v));
          }
View Full Code Here

          prev.set(strokes.get(sessionID).getLastPoint());
          if (prev.distanceTo(v) > minPointsDistance) {
            strokes.get(sessionID).addPoint(new GmlPoint(v, time, pressure, rotation, direction, thickness));
          }
          else {
            LOGGER.log(Level.FINE, "Skipped, too close from previous point: "+prev.distanceTo(v));
          }
        }
        else { // First point, add it
          strokes.get(sessionID).addPoint(new GmlPoint(v, time, pressure, rotation, direction, thickness));
        }
View Full Code Here

        if (point.time < minTime) continue;
        if (point.time > maxTime) break;
        pos.set(point);

        // use distance to previous point as target stroke weight
        weight += (pos.distanceTo(prev)*4-weight)*0.1;

        // define offset points for the triangle strip
        a.set(pos);
        b.set(pos);
        a.addSelf(0, 0, weight);
View Full Code Here

     
      if (prev.isZeroVector()) {
        prev.set(point.scale(scale));
      }
      cur = point.scale(scale);
      float dist = cur.distanceTo(prev);
      dist = PApplet.constrain(dist, 1, 20);
     
      g.pushMatrix();
      if (g.is3D()) {
        g.translate(cur.x, cur.y, cur.z);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.