Package javax.vecmath

Examples of javax.vecmath.Vector3d


        angle = (_angle).doubleValue();

        Quat4d quaternion = new Quat4d();
        quaternion.set(new AxisAngle4d(axisX, axisY, axisZ, angle));

        Vector3d vector = new Vector3d(xPosition, yPosition, zPosition);
        Transform3D t = new Transform3D(quaternion, vector, 1.0);
        TransformGroup group = _simpleUniverse.getViewingPlatform()
                .getViewPlatformTransform();
        group.setTransform(t);
        _initialPosition = _position;
View Full Code Here


            _textGeometry.setAlignment(align);
        } else if (attribute == fontSize) {
            if (_scaleTransform != null) {
                float size = (float) (((DoubleToken) fontSize.getToken())
                        .doubleValue());
                _scaleTransform.setScale(new Vector3d(size, size, 1.0f));

                // The following seems to be needed so the new scale
                // takes effect.
                ((TransformGroup) _containedNode).setTransform(_scaleTransform);
            }
View Full Code Here

        TransformGroup scaler = new TransformGroup();
        scaler.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        _scaleTransform = new Transform3D();

        float size = (float) (((DoubleToken) fontSize.getToken()).doubleValue());
        _scaleTransform.setScale(new Vector3d(size, size, 1.0f));
        scaler.setTransform(_scaleTransform);
        scaler.addChild(shape);
        _containedNode = scaler;

        if (_changesAllowedNow) {
View Full Code Here

    private TreeBranchStateFactory factory;

    protected void setUp() throws Exception {
        super.setUp();
        translationVector = new Vector3d(1.5, 3.6, 8.9);
        branchEndPoint = new Point3d(1, 2.7, 3);
        factory = new TreeBranchStateFactory();
        branchState = factory.createRandomBranchState(translationVector, branchEndPoint);
    }
View Full Code Here

    }

    public void testComputeBranchTranslationVector() {
        float treeRadius = 6;
        float treeHeight = 8;
        Vector3d translationVector = factory.computeBranchTranslationVector(treeRadius, treeHeight);
        PointTestHelper.assertPointIsWithinBounds(new Point3d(translationVector), new Point3d(-6, 8, -6), new Point3d(
                6, 8, 6));
        treeRadius = 0.2f;
        treeHeight = 15;
        translationVector = factory.computeBranchTranslationVector(treeRadius, treeHeight);
View Full Code Here

        }
        if (y < model_.getHeight() - 1) {
            ydelta = getConcentration(x, y+1) - concentration;
        }
        double htScale = options_.getHeightScale();
        Vector3d xVec = new Vector3d(1.0, 0.0, htScale * xdelta);
        Vector3d yVec = new Vector3d(0.0, 1.0, htScale * ydelta);
        Vector3d surfaceNormal = new Vector3d();
        surfaceNormal.cross(xVec, yVec);
        surfaceNormal.normalize();

        return computeColor(c, surfaceNormal);
    }
View Full Code Here

  public void testEvaluateForce() {

    myBond.evaluateForce();

    // Express the result as a Vector3d object
    Vector3d myAtom1Force = new Vector3d(0.0, -19.999999999999996, 0.0);
    Vector3d myAtom2Force = new Vector3d(0.0, 19.999999999999996, 0.0);

    assertEquals(myAtom1Force, myAtom1.getForce());
    assertEquals(myAtom2Force, myAtom2.getForce());

    LOG.debug("Force on myAtom1 is " + myAtom1.getForce().toString()
View Full Code Here

  /**
   * Returns the current distance between the two atoms, in Angstroms
   */
    double getCurrentDistance() {

    Vector3d dist = new Vector3d();
    dist.sub(i.getPosition(), j.getPosition());

    return dist.length();

  }
View Full Code Here

  /**
   * Calculates and imparts the force of the bond to its member atoms
   */
  public void evaluateForce() {

    Vector3d temp3d = new Vector3d();

    temp3d.sub(i.getPosition(), j.getPosition());

    double forceVectorSum = getAnalyticalGradient();
   
    double unitForce = forceVectorSum / temp3d.length();

    temp3d.scale(unitForce * scalingFactor);

    i.addForce(temp3d);
    j.subForce(temp3d);

  }
 
View Full Code Here

  /**
   * Returns the current distances between the two atoms in Angstroms
   */
  private double getCurrentDistance() {

    Vector3d dist = new Vector3d();
    dist.sub(i.getPosition(), j.getPosition());

    return dist.length();

  }
View Full Code Here

TOP

Related Classes of javax.vecmath.Vector3d

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.