Overview
The COLLADA loader enables you to load 3D models in the DAE (Digital Asset Exchange) format. COLLADA is an open standard XML-based format that supports animations, skeletal rigging, physics, and complex scene hierarchies.Usage
Parameters
Loader type. Must be
'dae' for COLLADA files.URL or path to the DAE model file.
Units for the model scale. Options:
'scene'- Scene units (default)'meters'- Meters
Scale factor for the model. Can be:
- A single number:
1(uniform scale) - An array:
[x, y, z]for per-axis scaling
scale: [2, 2, 2] or scale: 2Rotation for the model in degrees. Can be:
- A single number:
90(rotation around Y axis) - An object:
{ x: 90, y: 0, z: 0 } - An array:
[90, 0, 0](X, Y, Z rotation)
Anchor point for the model positioning. Options:
'center'- Center of the model'bottom-left'- Bottom-left corner'bottom-right'- Bottom-right corner'top-left'- Top-left corner'top-right'- Top-right corner'bottom-center'- Bottom center'top-center'- Top center'left'- Left center'right'- Right center
Manual adjustment to override the automatic center calculation.Example:
{ x: 0, y: 0, z: 0 }Normalize specular, metalness, and shininess properties for better rendering in Mapbox.
Index of the default animation to play from the model’s animation array.
Whether the model should be included in raycasting for mouse interactions.
Whether to calculate and display a bounding box for the model.
Whether to enable tooltips for the model.
Whether to clone the model when adding multiple instances.
Whether to send cookies and authorization headers with cross-origin requests.
Callback
The callback function receives the loaded model object with the following properties:Model Structure
COLLADA models are loaded with the following structure:- The
sceneproperty becomes the root object animationsarray is preserved and accessible viamodel.animations- All child meshes, lights, cameras, and scene hierarchy are included
- Materials and textures are loaded automatically
- Skeletal animations and morph targets are supported
/home/daytona/workspace/source/src/objects/loadObj.js:71-76:
Coordinate Systems
COLLADA supports different coordinate systems depending on the software used to create the model:- Y-up (Maya, Cinema 4D):
rotation: { x: 0, y: 0, z: 0 } - Z-up (Blender, 3ds Max):
rotation: { x: 90, y: 0, z: 0 }
Embedded Assets
COLLADA files can embed textures and other assets directly in the XML or reference external files:Examples
Basic COLLADA Model
COLLADA with Animation
Multiple Animations
Scene with Lights and Cameras
Normalization
COLLADA models may have high specular values. Use thenormalize option:
- Metalness by 90% (multiply by 0.1)
- Glossiness by 75% (multiply by 0.25)
- Sets specular color to
(12, 12, 12)for MeshStandardMaterial - Sets shininess to 0.1 for MeshPhongMaterial
Common Issues
Model Not Visible
If the model loads but isn’t visible:- Check the scale - COLLADA files may use different unit systems
- Verify rotation - adjust for coordinate system differences
- Check the anchor point - try
'center'or'bottom-center'
Texture Not Loading
If textures are missing:- Check browser console for loading errors
- Verify texture paths in the DAE file are correct
- Ensure CORS headers are set for external texture URLs
- Check that texture files exist at the referenced paths
Animation Issues
If animations don’t play:- Check if animations exist:
console.log(model.animations) - Verify the animation index is valid
- Use
model.idle()to initialize skeletal animations
Performance Considerations
COLLADA files can be large and complex:- Use
clone: trueto efficiently create multiple instances - Enable
normalize: trueto reduce rendering overhead - Consider converting complex DAE files to GLB for better performance
- Simplify mesh geometry and reduce polygon count if possible