Package toxi.geom

Examples of toxi.geom.Vec3D


   */
 
 
  @Test
  public void testGetNormalizerX() {
    Vec3D v = new Vec3D(.5f, .2f, .1f);
    Vec3D normalizer = Vec3DUtils.getNormalizer(v);
    assertTrue("normalizer", normalizer.equals(new Vec3D(2, 2, 2)));   
  }
View Full Code Here


    assertTrue("normalizer", normalizer.equals(new Vec3D(2, 2, 2)));   
  }
 
  @Test
  public void testGetNormalizerY() {
    Vec3D v = new Vec3D(.1f, .5f, .2f);
    Vec3D normalizer = Vec3DUtils.getNormalizer(v);
    assertTrue("normalizer", normalizer.equals(new Vec3D(2, 2, 2)));   
  }
View Full Code Here

    assertTrue("normalizer", normalizer.equals(new Vec3D(2, 2, 2)));   
  }
 
  @Test
  public void testGetNormalizerZ() {
    Vec3D v = new Vec3D(.1f, .2f, .5f);
    Vec3D normalizer = Vec3DUtils.getNormalizer(v);
    assertTrue("normalizer", normalizer.equals(new Vec3D(2, 2, 2)));   
  }
View Full Code Here

   *
   */
 
  @Test
  public void testGetNormalizedX() {
    Vec3D v = new Vec3D(.5f, .4f, .3f);
    v = Vec3DUtils.getNormalized(v);
    assertTrue("normalized x=1", v.equalsWithTolerance(new Vec3D(1f, .8f, .6f), 0.000001f));
  }
View Full Code Here

    assertTrue("normalized x=1", v.equalsWithTolerance(new Vec3D(1f, .8f, .6f), 0.000001f));
  }

  @Test
  public void testGetNormalizedY() {
    Vec3D v = new Vec3D(.4f, .5f, .3f);
    v = Vec3DUtils.getNormalized(v);
    assertTrue("normalized y=1", v.equalsWithTolerance(new Vec3D(.8f, 1f, .6f), 0.000001f));
  }
View Full Code Here

    assertTrue("normalized y=1", v.equalsWithTolerance(new Vec3D(.8f, 1f, .6f), 0.000001f));
  }

  @Test
  public void testGetNormalizedZ() {
    Vec3D v = new Vec3D(.3f, .4f, .5f);
    v = Vec3DUtils.getNormalized(v);
    assertTrue("normalized z=1", v.equalsWithTolerance(new Vec3D(.6f, .8f, 1f), 0.000001f));
  }
View Full Code Here

   *
   */
 
  @Test
  public void testTransposeXAxis(){
    Vec3D v = new Vec3D(.75f, .5f, .25f);
    Vec3D shift = new Vec3D(.5f, .5f, .5f);
    Vec3DUtils.transpose(v, shift, Vec3D.X_AXIS, (float) Math.PI/2);
    assertTrue("transpose on x", v.equalsWithTolerance(new Vec3D(.75f, .75f, .5f), .0000001f));
  }
View Full Code Here

  }

 
  @Test
  public void testTransposeYAxis(){
    Vec3D v = new Vec3D(.75f, .5f, .25f);
    Vec3D shift = new Vec3D(.5f, .5f, .5f);
    Vec3DUtils.transpose(v, shift, Vec3D.Y_AXIS, (float) Math.PI/2);
    assertTrue("transpose on y", v.equalsWithTolerance(new Vec3D(.25f, .5f, .25f), .0000001f));
  }
View Full Code Here

  }

 
  @Test
  public void testTransposeZAxis(){
    Vec3D v = new Vec3D(.75f, .5f, .25f);
    Vec3D shift = new Vec3D(.5f, .5f, .5f);
    Vec3DUtils.transpose(v, shift, Vec3D.Z_AXIS, (float) Math.PI/2);
    assertTrue("transpose on z", v.equalsWithTolerance(new Vec3D(.5f, .75f, .25f), .0000001f));
  }
View Full Code Here

   *
   */
 
  @Test
  public void testSwapPlusX() {
    Vec3D v = new Vec3D(.5f, 1, .25f);
    Vec3D up = new Vec3D(1, 0, 0);
    Vec3DUtils.swap(v, up);
    assertTrue("", v.equalsWithTolerance(new Vec3D(1, .5f, .25f), .0000001f));
  }
View Full Code Here

TOP

Related Classes of toxi.geom.Vec3D

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.