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

BufferGeometry.applyQuaternion()

The applyQuaternion() method of BufferGeometry rotates the geometry's vertices by a given quaternion.

Syntax

geometry.applyQuaternion(quaternion)
  • quaternion - a Quaternion object that represents the rotation to be applied to the vertices.

Description

This method applies the given quaternion to the geometry's vertices, effectively rotating the geometry in 3D space. The vertices are updated in place, so no new vertex data is generated.

Examples

Rotate a geometry by a quaternion:

const geometry = new THREE.BoxBufferGeometry(1, 1, 1);
const quaternion = new THREE.Quaternion().setFromEuler(new THREE.Euler(Math.PI / 4, 0, 0));

geometry.applyQuaternion(quaternion);

The above code rotates a box geometry by 45 degrees around the x-axis.

Remarks

  • This method modifies the vertices of the geometry in place, so any further modifications to the vertices will be relative to the rotated state.
  • This method can be used to rotate any type of BufferGeometry, including custom geometries.

See Also