<sk-scene-node>

← prev index next →

The base concept for the scene graph: the hierarchy of nodes that makes up a scene, each positioned relative to its parent.

Remarks

Every visible and invisible thing in a Skenra scene is a scene node, arranged in a tree under sk-scene. A node carries a transform — position (x/y/z), rotation (h/p/b as heading/pitch/bank angles), and scale (sx/sy/sz, or s for uniform) — and a node's transform is relative to its parent, so moving a group moves everything inside it. These transform attributes are shared by every node type: meshes, splines, lights, cameras, and fields all inherit them.

The family. A plain sk-scene-node is an invisible group used to transform its children together; sk-scene is the root that holds everything; sk-cloner instances its content across a points-source; and sk-orbit and sk-target-at are helper nodes that hold parameters a constraint reads (a pivot to orbit, or a point to look at). Concrete geometry, lights, and cameras are all scene nodes too.

The example groups two spheres under one node and rotates the group as a whole.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
id <id> The element's unique identifier — the standard HTML global id attribute.
draggable <boolean> false Gets whether this node can be dragged.
xanimatable <number> 0 X position.
yanimatable <number> 0 Y position.
zanimatable <number> 0 Z position.
hanimatable <angle> 0 Heading (Y-axis rotation) in radians.
panimatable <angle> 0 Pitch (X-axis rotation) in radians.
banimatable <angle> 0 Bank (Z-axis rotation) in radians.
quaternionanimatable <quaternion> ({ <number>, <number>, <number>, <number> }) Rotation as quaternion (overrides h, p, b if provided)
sxanimatable <number> 1 X-axis scale factor.
syanimatable <number> 1 Y-axis scale factor.
szanimatable <number> 1 Z-axis scale factor.
s <number> Uniform scale factor for all axes (overrides sx, sy, sz if provided) write-only

Event handler attributes

Standard DOM event-handler content attributes — the value is JavaScript run when the event fires. They behave exactly as on any HTML element.

onclick, ondblclick, onauxclick, oncontextmenu, onpointerdown, onpointerup, onpointermove, onpointercancel, onpointerover, onpointerout, onpointerenter, onpointerleave, ongotpointercapture, onlostpointercapture, onwheel, ondragstart, ondrag, ondragenter, ondragover, ondragleave, ondrop, ondragend