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

ObjectLoader.parseImages()

The ObjectLoader.parseImages() method is a function defined in the Three.js library that is used to parse images from JSON data. This function is typically used in conjunction with the ObjectLoader.parse() method to load and parse 3D object data.

Syntax

ObjectLoader.parseImages( json, onLoad, onProgress, onError );

Parameters

  • json — A JSON object representing the images to be loaded and parsed.
  • onLoad — A callback function that is called when all images have been loaded and parsed.
  • onProgress — A callback function that is called periodically to report the progress of the image loading process.
  • onError — A callback function that is called if any errors occur during the image loading and parsing process.

Return Value

This method does not return anything.

Example Usage

var loader = new THREE.ObjectLoader();

// Define a JSON object containing image data.
var imageJSON = {
  "textures": [
    {
      "uuid": "3C8B31C2-B32C-420D-B835-BDD5C2B75A46",
      "url": "textures/texture1.jpg"
    },
    {
      "uuid": "813A3F3C-0D56-480A-9D9C-20E8BF69A0A2",
      "url": "textures/texture2.jpg"
    }
  ]
};

// Load and parse the images from the JSON object.
loader.parseImages( imageJSON, function () {
  console.log( "Images loaded and parsed successfully!" );
}, function ( progress ) {
  console.log( "Loading progress: " + progress + "%" );
}, function ( error ) {
  console.log( "Error loading images: " + error );
} );

Additional Information

The ObjectLoader.parseImages() method is used internally by the ObjectLoader.parse() method to load and parse images as part of the overall 3D object loading process. This method is not typically called directly by front-end developers, but instead is called indirectly through the ObjectLoader.parse() method.

Note that the url property of each image in the JSON object is relative to the root directory of the web server. If the images are stored in a directory other than the root directory, this property must be updated accordingly.