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.transpose()

Matrix3.transpose() 方法将矩阵转置,即交换矩阵的行和列。

语法

matrix.transpose()

参数

该方法没有参数。

返回值

该方法没有返回值,但会修改调用该方法的矩阵实例。

示例

const matrix = new THREE.Matrix3();

matrix.set(
  1, 2, 3,
  4, 5, 6,
  7, 8, 9
);

console.log(matrix.toArray()); // [1, 2, 3, 4, 5, 6, 7, 8, 9]

matrix.transpose();

console.log(matrix.toArray()); // [1, 4, 7, 2, 5, 8, 3, 6, 9]

备注

该方法将矩阵的第一行变为第一列,第二行变为第二列,第三行变为第三列。

转置后的矩阵的第 i 行第 j 列的元素,等于转置前的矩阵的第 j 行第 i 列的元素。

参考文献