A COLLADA document is XML checked against the COLLADA schema that Khronos publishes.
This page follows the schema of version 1.4.1, the version most files use, checked
against COLLADA – Digital Asset Schema Release 1.4.1, Specification (2nd
Edition), March 2008 (Khronos Group and Sony Computer Entertainment,
khronos.org/files/collada_spec_1_4.pdf, read in full as text for this
page); it lists
the elements a reader meets and their attributes and children in schema order. Most
elements also allow asset (first) and extra (last) children,
and id and name attributes.
Root and versions
| Version | Namespace |
|---|---|
| 1.4.0, 1.4.1 | http://www.collada.org/2005/11/COLLADASchema |
| 1.5.0 | http://www.collada.org/2008/03/COLLADASchema |
The 1.4.1 specification gives the valid version values as 1.4.0 and 1.4.1
(required), and the 1.5.0 specification (April 2008) uses the 2008/03 namespace. The
root COLLADA also takes an optional xml:base attribute, the
base URI for relative references. It has version and the namespace, then:
asset (required); any number of libraries, in any order; one optional
scene; and extra elements. Elements refer to each other by
URL: #id for one in the same file, or file.dae#id.
asset
| Child | Contents |
|---|---|
contributor | any number, each with optional author, authoring_tool, comments, copyright, source_data |
created, modified | ISO 8601 date and time |
keywords, revision, subject, title | text |
unit | attributes meter (metres per unit, default 1.0) and name (default meter) |
up_axis | X_UP, Y_UP (default) or Z_UP |
All coordinates are right-handed. The up axis fixes the other two:
| Value | Right axis | Up axis | In axis |
|---|---|---|---|
X_UP | negative y | positive x | positive z |
Y_UP | positive x | positive y | positive z |
Z_UP | positive x | positive z | negative y |
When a parent and a child asset give the same value, such as unit, the
child’s applies within the child, recursively.
Libraries
| Library | Holds |
|---|---|
library_animations | animation |
library_animation_clips | animation_clip: a time range of animations |
library_cameras | camera |
library_controllers | controller: skins and morphs |
library_effects | effect: shading |
library_force_fields | force_field |
library_geometries | geometry: meshes, splines and convex meshes |
library_images | image |
library_lights | light |
library_materials | material |
library_nodes | node: reusable node trees |
library_physics_materials | physics_material |
library_physics_models | physics_model |
library_physics_scenes | physics_scene |
library_visual_scenes | visual_scene: trees of nodes |
scene picks what to show: instance_visual_scene and any
instance_physics_scene.
Nodes and transforms
A node has id, name, sid,
type (NODE, the default, or JOINT for a
bone) and layer. Its children, in order: transforms; then
instance_camera, instance_controller,
instance_geometry, instance_light,
instance_node; then child nodes.
| Transform | Values |
|---|---|
translate | x y z |
rotate | axis x y z and an angle in degrees |
scale | x y z |
matrix | 16 numbers, a 4×4 matrix written row by row (“column matrices in the mathematical sense … written in row-major order to aid the human reader”: the example translation 2, 3, 4 is 1 0 0 2 0 1 0 3 0 0 1 4 0 0 0 1) |
lookat | eye position, interest point and up vector, nine numbers, as in GLU: the interest point maps to the negative z axis, the eye to the origin and the up vector to positive y |
skew | seven numbers: an angle in degrees, then a rotation axis and a translation axis (as in RenderMan) |
Transforms apply in the order written: the specification says they are converted to
matrices and postmultiplied in the order given, to compose the node’s coordinate system.
Each can carry a sid so animations can target it, as in
Cube/rotationZ.ANGLE. rotate is an axis vector then an angle in
degrees. node’s layer attribute holds layer names separated by
spaces.
instance_geometry and instance_controller take a
bind_material, whose technique_common holds
instance_material elements: symbol (the name a primitive’s
material attribute uses), target (the material’s URL), and
bind_vertex_input children (semantic,
input_semantic, input_set) that tie a texture coordinate
name to a set of the mesh. instance_controller also has
skeleton elements naming the root joints.
Materials and effects
A material holds an instance_effect pointing at an
effect. The common profile, profile_COMMON, holds
newparam elements (a surface with
init_from naming an image, or a sampler2D with a
source), then a technique with one shading model:
| Model | Children, in order |
|---|---|
constant | emission, reflective, reflectivity, transparent, transparency, index_of_refraction |
lambert | emission, ambient, diffuse, reflective, reflectivity, transparent, transparency, index_of_refraction |
phong, blinn | emission, ambient, diffuse, specular, shininess, reflective, reflectivity, transparent, transparency, index_of_refraction |
A colour child holds a color (four numbers, RGBA), a
param with ref, or a texture with
texture (a sampler’s sid) and texcoord (a
symbol bound by bind_vertex_input). A number child holds a
float or a param. transparent has an
opaque attribute: A_ONE (default, alpha 1 is opaque) or
RGB_ZERO (the red, green and blue channels, with 0.0 opaque, each channel
modulated independently); the 1.5.0 specification adds A_ZERO and
RGB_ONE, and its text marks both A_ONE and A_ZERO
“the default”, so its default is unclear. Other profiles (profile_CG,
profile_GLSL, profile_GLES) hold shader programs.
Cameras, lights and images
| Element | Contents |
|---|---|
camera (children asset, optics, optional imager, extra) / optics / technique_common | perspective: either xfov, or yfov, or both, or aspect_ratio with one of them (angles in degrees; a missing aspect ratio comes from the viewport), then znear, zfar (both required, in the units of the scope’s unit); or orthographic: the same rule with xmag and ymag (scale factors: the viewport becomes −xmag to xmag and −ymag to ymag), znear, zfar. Each of these numbers may carry an optional sid. |
light / technique_common | ambient or directional (a color); point (color, constant_attenuation default 1.0, linear_attenuation default 0.0, quadratic_attenuation default 0.0); spot (those, plus falloff_angle default 180.0 and falloff_exponent default 0.0). The color is three floats, RGB. Attenuation is A = constant + Dist × linear + Dist² × quadratic. |
image | optional asset; init_from (a file URL) or data (hexadecimal bytes); then extra. Attributes, all optional: id, name, format (for example JPG, when the file extension does not say), width, height and depth in pixels (depth 1 by default, for a 2-D image) |
Cameras look down their node’s −Z axis, with +X to the right and +Y at the top; lights
shine along −Z (default direction [0, 0, −1]). Both are affected by the asset’s
up_axis.
Controllers
| Element | Contents |
|---|---|
skin (source: the geometry) | bind_shape_matrix; three or more sources; joints with inputs JOINT and INV_BIND_MATRIX; vertex_weights (count) with inputs JOINT and WEIGHT, vcount (influences per vertex) and v (pairs of joint and weight indices; joint −1 means the bind shape) |
morph (source, method) | method NORMALIZED (default) or RELATIVE; two or more sources; targets with inputs MORPH_TARGET and MORPH_WEIGHT |
Animation
An animation holds sources, samplers and
channels, and may nest further animations. A sampler’s
inputs name the key times (INPUT), the values
(OUTPUT), the interpolation of each key (INTERPOLATION) and
any tangents (IN_TANGENT, OUT_TANGENT). The interpolation
source is a Name_array of LINEAR, BEZIER,
HERMITE, CARDINAL, BSPLINE or
STEP. A channel has source (the sampler) and
target, a path of ids and sids to an animated value, with an optional
member such as .X, .ANGLE or (3)(2) for one
matrix element.
The specification defines the target syntax in three parts: the id of an
element (or . for a relative address); zero or more /-separated
sids; and an optional member, either .NAME (symbolic) or
(n) with n counted from zero (array access, usable only on
one-dimensional vectors and two-dimensional matrices, as mat(3)(2)). If the
member is left out, all the values of the target are animated. In-between elements need no
id or sid: a target may skip them, such as the
optics and technique of a camera. A sid is unique
among the same path level of its parent. A target has no #, unlike a
url or source, which are URI references (RFC 3986) whose fragment
is the element’s id. Paths must be valid URIs, so spaces are written
%20 and Windows paths use forward slashes; relative paths are preferred.