rotatePointWithPoint static method

dynamic rotatePointWithPoint(
  1. Vector3 point,
  2. Vector3 rotateAxis,
  3. num angle
)

Implementation

static rotatePointWithPoint(Vector3 point, Vector3 rotateAxis, num angle) {
  var p = point.clone();

  var axis = rotateAxis;

  // Define the matrix:
  var matrix = Matrix4();

  // Define the rotation in radians:
  var radians = angle * Math.pi / 180.0;

  // Rotate the matrix:
  matrix.makeRotationAxis(axis, radians);

  // Now apply the rotation to all vectors in the tree
  // Define the vector3:

  p.applyMatrix4(matrix);

  return p;
}