BufferGeometry
Object3D
Raycaster
Camera
CubeCamera
PerspectiveCamera
OrthographicCamera
StereoCamera
Clock
Curve
CurvePath
Path
Shape
ShapePath
ArrowHelper
AxesHelper
BoxHelper
Box3Helper
CameraHelper
DirectionalLightHelper
GridHelper
PolarGridHelper
HemisphereLightHelper
PlaneHelper
PointLightHelper
SkeletonHelper
SpotLightHelper
Light
PointLight
RectAreaLight
SpotLight
DirectionalLight
HemisphereLight
LightShadow
PointLightShadow
AnimationLoader
AudioLoader
BufferGeometryLoader
CompressedTextureLoader
CubeTextureLoader
DataTextureLoader
FileLoader
ImageBitmapLoader
ImageLoader
Loader
LoaderUtils
MaterialLoader
ObjectLoader
TextureLoader
LoadingManager
Material
Box2
Box3
Color
Cylindrical
Euler
Frustum
Interpolant
Line3
MathUtils
Matrix3
Matrix4
Plane
Quaternion
AnimationAction
AnimationClip
AnimationMixer
AnimationObjectGroup
AnimationUtils
keyframeTrack
PropertyBinding
PropertyMixer
BooleanKeyframeTrack
QuaternionKeyframeTrack
StringKeyframeTrack
Audio
AudioAnalyser
AudioContext
AudioListener
PositionalAudio

Matrix3.makeRotation()

该方法用于创建一个旋转矩阵。该矩阵将会被用于旋转三维物体。该方法接受一个角度和一个轴向量作为参数。

语法

Matrix3.makeRotation(angle, axis);

参数

  • angle:需要旋转的角度,以弧度为单位。
  • axis:代表旋转方向的轴向量。该向量必须是归一化的(长度为1)。

返回值

没有返回值。该方法会修改调用者的矩阵。

示例

const rotationMatrix = new THREE.Matrix3();
const angle = Math.PI / 2;
const axis = new THREE.Vector3(0, 1, 0).normalize();

rotationMatrix.makeRotation(angle, axis);

console.log(rotationMatrix);

版本

该方法在Three.js r125 版本中被引入。

参考资料