This node can be used to access transformation related metrics of 3D objects. Depending on the selected scope, a different metric is represented as a uniform in the shader. The following scopes are supported:
-
POSITION: The object’s position in world space. -
VIEW_POSITION: The object’s position in view/camera space. -
DIRECTION: The object’s direction in world space. -
SCALE: The object’s scale in world space. -
WORLD_MATRIX: The object’s matrix in world space.
Constructor
new Object3DNode(scope, object3d?)| Parameter | Type | Default Value |
|---|---|---|
| scope | "position" | "viewPosition" | "direction" | "scale" | "worldMatrix" | — |
| object3d? | any | null |
Constructs a new object 3D node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| scope | "position" | "viewPosition" | "direction" | "scale" | "worldMatrix" | — | |
| object3d | any | — | |
| uniformNode | UniformNode | — | |
| Method | Type | |
|---|---|---|
| generateNodeType | () => "vec3" | "float" | "mat4" | |
| update | (frame: NodeFrame) => void | |
| generate | (builder: NodeBuilder) => string | |
| serialize | (data: any) => void | |
| deserialize | (data: any) => void | |
Extends
NodeTSL function for creating an object 3D node that represents the object’s direction in world space.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<vec3>TSL function for creating an object 3D node that represents the object’s world matrix.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<mat4>TSL function for creating an object 3D node that represents the object’s position in world space.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<vec3>TSL function for creating an object 3D node that represents the object’s scale in world space.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<vec3>TSL function for creating an object 3D node that represents the object’s position in view/camera space.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<vec3>TSL function for creating an object 3D node that represents the object’s radius.
| Parameter | Type | Default Value |
|---|---|---|
| object3d? | Object3D | — |
Returns
Object3DNode<float>