Список устаревших элементов API
Поскольку интерфейсthree.js
довольно быстро развивается, можно столкнуться с примерами, предлагающими использование элементов API, которые больше не являются частью ядра.Ниже приведен список таких элементов, а также информация относительно их замены.
Звуковое сопровождение
Audio
Audio.load устарел, взамен используйте AudioLoader.AudioAnalyser
AudioAnalyser.getData() был переименован в AudioAnalyser.getFrequencyData().BinaryTextureLoader
BinaryTextureLoader был переименован в DataTextureLoader.Буферные элементы
BufferAttribute
BufferAttribute.length был переименован в BufferAttribute.count.DynamicBufferAttribute
DynamicBufferAttribute был удален. Вместо него используйте BufferAttribute.setDynamic( true ).Int8Attribute
Int8Attribute был удален. Вместо него используйте Int8BufferAttribute.Uint8Attribute
Uint8Attribute был удален. Вместо него используйте Uint8BufferAttribute.Uint8ClampedAttribute
Uint8ClampedAttribute был удален. Вместо него используйте Uint8ClampedBufferAttribute.Int16Attribute
Int16Attribute был удален. Вместо него используйте Int16BufferAttribute.Uint16Attribute
Uint16Attribute был удален. Вместо него используйте Uint16BufferAttribute.Int32Attribute
Int32Attribute был удален. Вместо него используйте Int32BufferAttribute.Uint32Attribute
Uint32Attribute был удален. Вместо него используйте Uint32BufferAttribute.Float32Attribute
Float32Attribute был удален. Вместо него используйте Float32BufferAttribute.Float64Attribute
Float64Attribute был удален. Вместо него используйте Float64BufferAttribute.Камеры
PerspectiveCamera
PerspectiveCamera.setLens() is deprecated. Use [page:PerspectiveCamera.setFocalLength() and [page:PerspectiveCamera.filmGauge() for a photographic setup.Константы
[page:LineStrip]
[page:LinePieces]
LinePieces mode is no longer supported for [page:Line]s. Create a [page:LineSegments] instead.Core
[page:EventDispatcher]
EventDispatcher.apply has been removed. Inherit or Object.assign the prototype to mix-in instead.[page:Raycaster]
Raycaster.params.PointCloud has been renamed to [page:Raycaster.params.Points].[page:Uniform]
Uniform.dynamic has been removed. Use object.onBeforeRender() instead.Uniform.onUpdate has been removed. Use object.onBeforeRender() instead.
Extras
[page:ClosedSplineCurve3]
ClosedSplineCurve3 has been deprecated. Use [page:CatmullRomCurve3] instead.[page:SplineCurve3]
SplineCurve3 has been deprecated. Use [page:CatmullRomCurve3] instead.Geometry
[page:BufferGeometry]
BufferGeometry.addIndex has been renamed to [page:BufferGeometry.setIndex].BufferGeometry.addDrawCall is now [page:BufferGeometry.addGroup].
BufferGeometry.clearDrawCalls is now [page:BufferGeometry.clearGroups].
BufferGeometry.computeTangents has been removed.
BufferGeometry.computeOffsets has been removed.
BufferGeometry.drawcalls has been renamed to [page:BufferGeometry.groups].
BufferGeometry.offsets has been renamed to [page:BufferGeometry.groups].
[page:CubeGeometry]
CubeGeometry has been renamed to [page:BoxGeometry].[page:Geometry]
Geometry.computeTangents() has been removed.[page:GeometryUtils]
GeometryUtils.merge has been moved to [page:Geometry]. Use [page:Geometry.merge]( geometry2, matrix, materialIndexOffset ) instead.GeometryUtils.center has been moved to [page:Geometry]. Use [page:Geometry.center]( ) instead.
[page:Plane]
Plane.isIntersectionLine]() has been renamed to [page:Plane.intersectsLine]().Helpers
[page:BoundingBoxHelper]
BoundingBoxHelper has been deprecated. Use [page:BoxHelper] instead.[page:EdgesHelper]
EdgesHelper has been removed. Use [page:EdgesGeometry] instead.[page:GridHelper]
GridHelper.setColors() has been deprecated, pass them in the constructor instead.[page:WireframeHelper WireframeHelper]
WireframeHelper has been removed. Use [page:WireframeGeometry] instead.Lights
[page:Light]
Light.onlyShadow has been removed.Light.shadowCameraLeft is now [page:Light.shadow.camera.left].
Light.shadowCameraRight is now [page:Light.shadow.camera.right].
Light.shadowCameraTop is now [page:Light.shadow.camera.top].
Light.shadowCameraBottom is now [page:Light.shadow.camera.bottom].
Light.shadowCameraNear is now [page:Light.shadow.camera.near].
Light.shadowCameraFar is now [page:Light.shadow.camera.far].
Light.shadowCameraVisible has been removed. Use [page:CameraHelper] ( light.shadow.camera ) instead.
Light.shadowMapWidth is now [page:Light.shadow.mapSize.width].
Light.shadowMapHeight is now [page:Light.shadow.mapSize.height].
Loaders
[page:XHRLoader]
XHRLoader has been renamed to [page:FileLoader].Maths
[page:Box2]
Box2.center has been renamed to [page:Box2.getCenter]().Box2.empty has been renamed to [page:Box2.isEmpty]().
Box2.isIntersectionBox has been renamed to [page:Box2.intersectsBox]().
Box2.size has been renamed to [page:Box2.getSize]().
[page:Box3]
Box3.center has been renamed to [page:Box3.getCenter]().Box3.empty has been renamed to [page:Box3.isEmpty]().
Box3.isIntersectionBox has been renamed to [page:Box3.intersectsBox]().
Box3.isIntersectionSphere has been renamed to [page:Box3.intersectsSphere]().
Box3.size has been renamed to [page:Box3.getSize]().
[page:Face4]
Face4 has been removed. Use [page:Face3] instead.[page:Line3]
Line3.center has been renamed to [page:Line3.getCenter]().[page:Math]
Math.random16() has been deprecated. Use Math.random() instead.[page:Matrix3]
Matrix3.flattenToArrayOffset is deprecated. Use [page:Matrix3.toArray]() instead.Matrix3.multiplyVector3 has been removed. Use vector.applyMatrix3( matrix ) instead.
Matrix3.multiplyVector3Array has been renamed to [page:Matrix3.applyToVector3Array]( array ).
Matrix3.applyToBuffer has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.
Matrix3.applyToVector3Array has been removed.
[page:Matrix4]
Matrix4.flattenToArrayOffset() is deprecated. Use [page:Matrix4.toArray]() instead.Matrix4.extractPosition() has been renamed to [page:Matrix4.copyPosition]( matrix ).
Matrix4.getPosition() has been removed. Use [page:Vector3.setFromMatrixPosition]( matrix ) instead.
Matrix4.setRotationFromQuaternion() has been renamed to [page:Matrix4.makeRotationFromQuaternion]( quaternion ).
Matrix4.multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.
Matrix4.multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.
Matrix4.multiplyVector3Array() has been renamed to [page:Matrix4.applyToVector3Array] ( array ).
Matrix4.rotateAxis() has been removed. Use [page:Matrix4.transformDirection]( matrix ) instead.
Matrix4.crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.
Matrix4.rotateX() has been removed.
Matrix4.rotateY() has been removed.
Matrix4.rotateZ() has been removed.
Matrix4.rotateByAxis() has been removed.
Matrix4.applyToBuffer() has been removed. Use matrix.applyToBufferAttribute() instead.
Matrix4.applyToVector3Array() has been removed.
Matrix4.makeFrustum() has been removed. Use [page:Matrix4.makePerspective]( left, right, top, bottom, near, far ) instead.
[page:Quaternion.multiplyVector3]
Quaternion.multiplyVector3() has been removed. Use vector.applyQuaternion( quaternion ) instead.[page:Ray]
Ray.isIntersectionBox() has been renamed to [page:Ray.intersectsBox]().Ray.isIntersectionPlane has been renamed to [page:Ray.intersectsPlane].
Ray.isIntersectionSphere has been renamed to [page:Ray.intersectsSphere].
[page:Vector2]
Vector2.fromAttribute() has been renamed to [page:Vector2.fromBufferAttribute]().[page:Vector3]
Vector3.setEulerFromRotationMatrix() has been removed. Use [page:Euler.setFromRotationMatrix]() instead.Vector3.setEulerFromQuaternion() has been removed. Use [page:Euler.setFromQuaternion]() instead.
Vector3.getPositionFromMatrix() has been renamed to [page:Vector3.setFromMatrixPosition]().
Vector3.getScaleFromMatrix() has been renamed to [page:Vector3.setFromMatrixScale]().
Vector3.getColumnFromMatrix() has been renamed to [page:Vector3.setFromMatrixColumn]().
Vector3.applyProjection() has been removed. Use [page:Vector3.applyMatrix4]() instead.
Vector3.fromAttribute() has been renamed to [page:Vector3.fromBufferAttribute]().
[page:Vector4]
Vector4.fromAttribute() has been renamed to [page:Vector4.fromBufferAttribute]().[page:Vertex]
Vertex has been removed. Use [page:Vector3] instead.[page:Spline]
Spline has been removed. Use [page:CatmullRomCurve3] instead.Materials
[page:Material]
Material.wrapAround has been removed.Material.wrapRGB has been removed.
[page:MeshFaceMaterial]
MeshFaceMaterial has been removed. Use [page:MultiMaterial] instead.[page:MeshPhongMaterial]
MeshPhongMaterial.metal has been removed. Use [page:MeshStandardMaterial] instead.[page:ParticleBasicMaterial]
ParticleBasicMaterial has been renamed to [page:PointsMaterial].[page:ParticleSystemMaterial]
ParticleBasicMaterial has been renamed to [page:PointsMaterial].[page:PointCloudMaterial]
PointCloudMaterial has been renamed to [page:PointsMaterial].[page:ShaderMaterial.derivatives]
ShaderMaterial.derivatives has been moved to [page:ShaderMaterial.extensions.derivatives].Objects
[page:LOD.objects]
LOD.objects has been renamed to [page:LOD.levels].[page:Object3D]
Object3D.eulerOrder is now [page:Object3D.rotation.order].Object3D.getChildByName() has been renamed to [page:Object3D.getObjectByName]().
Object3D.renderDepth has been removed. Use [page:Object3D.renderOrder] instead.
Object3D.translate() has been removed. Use [page:Object3D.translateOnAxis]( axis, distance ) instead.
Object3D.useQuaternion has been removed. The library now uses quaternions by default.
[page:Particle]
ParticleSystem has been renamed to [page:Sprite].[page:ParticleSystem]
ParticleSystem has been renamed to [page:Points].[page:PointCloud]
PointCloud has been renamed to [page:Points].[page:Shape]
Shape.extrude has been removed. Use [page:ExtrudeGeometry] instead.Shape.makeGeometry has been removed. Use [page:ShapeGeometry] instead.
Renderer
[page:Projector]
CanvasRenderer был перенесен в /examples/js/renderers/CanvasRenderer.js.[page:Projector]
Projector был перенесен в /examples/js/renderers/Projector.js.Projector.projectVector() is now [page:Vector.project]().
Projector.unprojectVector() is now [page:Vector.unproject]().
Projector:.pickingRay() is now [page:Raycaster.setFromCamera]().
[page:WebGLProgram]
WebGLProgram.uniforms is now [page: WebGLProgram.getUniforms]().WebGLProgram.attributes is now [page: WebGLProgram.getAttributes]().
[page:WebGLRenderer]
WebGLRenderer.supportsFloatTextures() is now [page:WebGLRenderer.extensions.get]( 'OES_texture_float' ).WebGLRenderer.supportsHalfFloatTextures() is now [page:WebGLRenderer.extensions.get]( 'OES_texture_half_float' ).
WebGLRenderer.supportsStandardDerivatives() is now [page:WebGLRenderer.extensions.get]( 'OES_standard_derivatives' ).
WebGLRenderer.supportsCompressedTextureS3TC() is now [page:WebGLRenderer.extensions.get]( 'WEBGL_compressed_texture_s3tc' ).
WebGLRenderer.supportsCompressedTexturePVRTC() is now [page:WebGLRenderer.extensions.get]( 'WEBGL_compressed_texture_pvrtc' ).
WebGLRenderer.supportsBlendMinMax() is now [page:WebGLRenderer.extensions.get]( 'EXT_blend_minmax' ).
WebGLRenderer.supportsVertexTextures() is now [page:WebGLRenderer.capabilities.vertexTextures].
WebGLRenderer.supportsInstancedArrays() is now [page:WebGLRenderer.extensions.get]( 'ANGLE_instanced_arrays' ).
WebGLRenderer.enableScissorTest() is now [page:WebGLRenderer.setScissorTest]().
WebGLRenderer.initMaterial() has been removed.
WebGLRenderer.addPrePlugin() has been removed.
WebGLRenderer.addPostPlugin() has been removed.
WebGLRenderer.updateShadowMap() has been removed.
WebGLRenderer.setTexture is deprecated, use [page:WebGLRenderer.setTexture2D]() instead.
WebGLRenderer.shadowMapEnabled is now [page:WebGLRenderer.shadowMap.enabled].
WebGLRenderer.shadowMapType is now [page:WebGLRenderer.shadowMap.type].
WebGLRenderer.shadowMapCullFace is now [page:WebGLRenderer.shadowMap.cullFace].
WebGLRenderer.shadowMap.cullFace is deprecated. Set [page:WebGLRenderer.shadowMap.renderReverseSided] to true or false instead.
[page:WebGLRenderTarget]
WebGLRenderTarget.wrapS is now [page:WebGLRenderTarget.texture.wrapS].WebGLRenderTarget.wrapT is now [page:WebGLRenderTarget.texture.wrapT].
WebGLRenderTarget.magFilter is now [page:WebGLRenderTarget.texture.magFilter].
WebGLRenderTarget.minFilter is now [page:WebGLRenderTarget.texture.minFilter].
WebGLRenderTarget.anisotropy is now [page:WebGLRenderTarget.texture.anisotropy].
WebGLRenderTarget.offset is now [page:WebGLRenderTarget.texture.offset].
WebGLRenderTarget.repeat is now [page:WebGLRenderTarget.texture.repeat].
WebGLRenderTarget.format is now [page:WebGLRenderTarget.texture.format].
WebGLRenderTarget.type is now [page:WebGLRenderTarget.texture.type].
WebGLRenderTarget.generateMipmaps is now [page:WebGLRenderTarget.texture.generateMipmaps].
Текстуры
[page:ImageUtils
ImageUtils.loadTexture устарел. Вместо него используйте TextureLoader.ImageUtils.loadTextureCube устарел. Вместо него используйте CubeTextureLoader.
ImageUtils.loadCompressedTexture был удален. Вместо него используйте DDSLoader.
ImageUtils.loadCompressedTextureCube был удален. Вместо него используйте DDSLoader.