rotatePointWithPoint static method

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

Implementation

static rotatePointWithPoint(Vector3 point, Vector3 rotateAxis, num angle) {
  var _point = 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:

  _point.applyMatrix4(matrix);

  return _point;
}