User Tools

Site Tools


node

Description

This object defines a node that makes up part of a node hierarchy. It can represent nodes of a variety of types such as bones and figure roots.

Parent Object

Properties

Name Description Default Required
id A string representing the unique ID for this asset within the current file scope. None yes
name A string representing the “internal” name for this node. Generally unique within any sibling nodes. None yes
type A string representing the base type for this node. Can be “node”, “bone”, “figure”, “camera”, or “light”. See Extended By. “node” no
label A string representing the user facing label for this node. None yes
source A string representing the URI of the node asset that this node asset was derived from. “” no
parent A string representing the URI of the parent node definition. Parents must appear above children in the file. None no
rotation_order A string representing the rotation order to use when interpreting channel-based animation data for this node. Valid values are “XYZ”, “YZX”, “ZYX”, “ZXY”, “XZY”, and “YXZ”. “XYZ” no
inherits_scale A boolean value indicating whether or not the immediate parent node's local scale is compensated for when calculating this node's world space transform. If false, this node's world space transform is multiplied by the inverse of parent node's local scale. true (except for a bone with a bone parent) no
center_point An array of x, y, and z channel_float definitions for the center point of this node. [0, 0, 0 ] no
end_point An array of x, y, and z channel_float definitions for the end point of this node. [0, 0, 0 ] no
orientation An array of x, y, and z channel_float definitions for the (Euler) rotation of this node. [0, 0, 1, 0] no
rotation An array of x, y, and z channel_float definitions for the (Euler) rotation of this node. [0, 0, 0] (for “value”) no
translation An array of x, y, and z channel_float definitions for the translation of this node. [0, 0, 0 ] (for “value”) no
scale An array of x, y, and z channel_float definitions for the individual (i.e. x, y, or z-axis) scale of this node. [1, 1, 1] (for “value”) no
general_scale A channel_float definition for the general (i.e. 3-axis) scale of this node. 1 (for “value”) no
presentation A presentation object representing the user-facing presentation information for this node. N/A no
formulas An array of formula objects owned by this node. N/A no
extra An array of objects that represent additional application-specific information for this object. N/A no

Extended By

Details

If type is set to “figure” then this node is understood to be the root node of a figure.

The name attribute may be used by applications to provide another addressing mechanism for nodes in the scene. In object URI’s, if “name” is used as the scheme identifier, then the value of the name attribute is used to look up an item rather than using the id attribute. If the name attribute is missing, applications should use the id attribute in its place wherever needed.

The translation, rotation, scale, and general_scale elements each represent transforms that convert to transform matrices. To arrive at the full base transform for the node, each of those elements is converted to matrix form. The full transform for a node is determined using the following algorithm:

  • center_offset = center_point - parent.center_point
  • global_translation = parent.global_transform * (center_offset + translation)
  • global_rotation = parent.global_rotation * orientation * rotation * (orientation)-1
  • global_scale for nodes that inherit scale = parent.global_scale * orientation * scale * general_scale * (orientation)-1
  • global_scale for nodes = parent.global_scale * (parent.local_scale)-1 * orientation * scale * general_scale * (orientation)-1
  • global_transform = global_translation * global_rotation * global_scale

Vertices are taken to global space by post-multiplying as follows:

  • global_vertex = global_transform * vertex

Example

{
	"id" : "hip",
	"type" : "bone",
	"label" : "Hip",
	"parent" : "#Genesis",
	"rotation_order" : "YZX",
	"inherits_scale" : true,
	"center_point" : [
		channel_float,
		channel_float,
		channel_float
	],
	"end_point" : [
		channel_float,
		channel_float,
		channel_float
	],
	"orientation" : [
		channel_float,
		channel_float,
		channel_float
	],
	"rotation" : [
		channel_float,
		channel_float,
		channel_float
	],
	"translation" : [
		channel_float,
		channel_float,
		channel_float
	],
	"scale" : [
		channel_float,
		channel_float,
		channel_float
	],
	"general_scale" : channel_float
}