Examples of Vec3D


Examples of toxi.geom.Vec3D

   
  public void testNormalizeAllShiftedAhead() {
    Gml gml = new Gml();

    GmlStroke stroke = new GmlStroke();
    stroke.addPoint(new GmlPoint(new Vec3D(.2f, .1f, .25f), .01f, 1, new Vec3D(), new Vec3D()));
    stroke.addPoint(new GmlPoint(new Vec3D(.6f, .2f, .3f), .01f, 1, new Vec3D(), new Vec3D()));
    stroke.addPoint(new GmlPoint(new Vec3D(1.3f, 1.25f, 1.8f), .04f, 1, new Vec3D(), new Vec3D()));
    stroke.setLayer(0);
    gml.addStroke(stroke);
   
    GmlUtils.normalize(gml);
   
    assertTrue("bounds", GmlUtils.isNormalized(gml));
    assertTrue("origin", gml.environment.originalOriginShift.equalsWithTolerance(new Vec3D(0.19999999f, 0.100000024f, .25f), 0.000001f));
    assertTrue("aspect ratio", gml.environment.originalAspectRatio.equalsWithTolerance(new Vec3D(1.0999999f, 1.15f, 1.55f), .0000001f));
   
    assertTrue("normalized origin", gml.environment.normalizedOriginShift.equalsWithTolerance(new Vec3D(0.12903225f, 0.06451615f, 0.16129033f), .000001f));
    assertTrue("normalized aspect ratio", gml.environment.normalizedAspectRatio.equalsWithTolerance(new Vec3D(0.7096774f, 0.7419355f, 1f), .0000001f));
  }
View Full Code Here

Examples of toxi.geom.Vec3D

 
  public void testNormalizeAllShiftedBefore() {
    Gml gml = new Gml();

    GmlStroke stroke = new GmlStroke();
    stroke.addPoint(new GmlPoint(new Vec3D(-.2f, -.1f, -.25f), .01f, 1, new Vec3D(), new Vec3D()));
    stroke.addPoint(new GmlPoint(new Vec3D(.6f, .2f, .3f), .01f, 1, new Vec3D(), new Vec3D()));
    stroke.addPoint(new GmlPoint(new Vec3D(.7f, .7f, .6f), .04f, 1, new Vec3D(), new Vec3D()));
    stroke.setLayer(0);
    gml.addStroke(stroke);
   
    GmlUtils.normalize(gml);
   
    assertTrue("bounds", GmlUtils.isNormalized(gml));
    assertTrue("origin", gml.environment.originalOriginShift.equalsWithTolerance(new Vec3D(-.2f, -.1f, -.25f), 0.0000001f));
    assertTrue("aspect ratio", gml.environment.originalAspectRatio.equalsWithTolerance(new Vec3D(.9f, 0.8000001f, .85f), .0000001f));
   
    assertTrue("normalized origin", gml.environment.normalizedOriginShift.equalsWithTolerance(new Vec3D(-0.22222224f, -0.11111111f, -0.2777778f), .000001f));
    assertTrue("normalized aspect ratio", gml.environment.normalizedAspectRatio.equalsWithTolerance(new Vec3D(1f, 0.888889f, .94444454f), .0000001f));
  }
View Full Code Here

Examples of toxi.geom.Vec3D

   *
   */
 
  @Test
  public void testGetSmallestAxisSizeX() {
    float size = Vec3DUtils.getSmallestAxisSize(new Vec3D(.1f, .2f, .3f));
    assertTrue("x is the smallest", size == .1f);
  }
View Full Code Here

Examples of toxi.geom.Vec3D

    assertTrue("x is the smallest", size == .1f);
  }

  @Test
  public void testGetSmallestAxisSizeY() {
    float size = Vec3DUtils.getSmallestAxisSize(new Vec3D(.2f, .1f, .3f));
    assertTrue("y is the smallest", size == .1f);
  }
View Full Code Here

Examples of toxi.geom.Vec3D

    assertTrue("y is the smallest", size == .1f);
  }

  @Test
  public void testGetSmallestAxisSizeZ() {
    float size = Vec3DUtils.getSmallestAxisSize(new Vec3D(.2f, .3f, .1f));
    assertTrue("z is the smallest", size == .1f);
  }
View Full Code Here

Examples of toxi.geom.Vec3D

   * Longest axis size tests
   *
   */
  @Test
  public void testGetLongestAxisSizeX() {
    float size = Vec3DUtils.getLongestAxisSize(new Vec3D(.3f, .2f, .1f));
    assertTrue("x is the longest", size == .3f);
  }
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.