Package org.mt4j.util.math

Examples of org.mt4j.util.math.Vector3D.normalizeLocal()


  private Vector3D getClosestVecToVecOnSegment(Vector3D p, Vector3D segmentStart, Vector3D segmentEnd) {
          Vector3D c = p.getSubtracted(segmentStart);
          Vector3D v = segmentEnd.getSubtracted(segmentStart);
 
          float d = v.length();
          v.normalizeLocal();
 
          float t = v.dot(c);
 
          // Check to see if t is beyond the extents of the line segment
          if (t < 0.0f) {
View Full Code Here


      for (int i = 0; i < normals.length; i++) {
        Vector3D n = normals[i];
        if (n == null){
          n = new Vector3D(0,0,1);
        }else{
          n.normalizeLocal();
        }
      }
    }else
    {
      //Create face normals for unindexed geometry
View Full Code Here

               
                float scaledStepDistance = stepDistance*brushScale;

                Vector3D direction = pos.getSubtracted(lastDrawnPoint);
                float distance = direction.length();
                direction.normalizeLocal();
                direction.scaleLocal(scaledStepDistance);

                float howManySteps = distance/scaledStepDistance;
                int stepsToTake = Math.round(howManySteps);

View Full Code Here

            rotationAxis.rotateZ(ToolsMath.PI); //better than angle*-1
//            rotationAxis.rotateX(PApplet.radians(180)); //better than angle*-1
//            rotationAxis.scaleLocal(-1); //like angle*-1
//            rotationAxis.rotateAroundAxisLocal(rotationAxis, PApplet.radians(90));
          }
          rotationAxis.normalizeLocal();
         
          //TODO map points that didnt intersect to sphere
         
          //TODO measure distance from cam to sphere intersection point and multiply angle
          //so that if distance big -> less angle, if distance small -> more angle
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.