Object3DNode

Last modified: Jun 30, 2024

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?)
ParameterTypeDefault Value
scope"position" | "viewPosition" | "direction" | "scale" | "worldMatrix"
object3d?anynull

Constructs a new object 3D node.

AccessorType

Properties

PropertyTypeDefault Value
scope"position" | "viewPosition" | "direction" | "scale" | "worldMatrix"
object3dany
uniformNodeUniformNode
MethodType

Extends

Node

objectDirection

TSL function for creating an object 3D node that represents the object’s direction in world space.

ParameterTypeDefault Value
object3d?Object3D

Returns

Object3DNode<vec3>

objectWorldMatrix

TSL function for creating an object 3D node that represents the object’s world matrix.

ParameterTypeDefault Value
object3d?Object3D

Returns

Object3DNode<mat4>

objectPosition

TSL function for creating an object 3D node that represents the object’s position in world space.

ParameterTypeDefault Value
object3d?Object3D

Returns

Object3DNode<vec3>

objectScale

TSL function for creating an object 3D node that represents the object’s scale in world space.

ParameterTypeDefault Value
object3d?Object3D

Returns

Object3DNode<vec3>

objectViewPosition

TSL function for creating an object 3D node that represents the object’s position in view/camera space.

ParameterTypeDefault Value
object3d?Object3D

Returns

Object3DNode<vec3>

objectRadius

TSL function for creating an object 3D node that represents the object’s radius.

ParameterTypeDefault Value
object3d?Object3D

Returns

Object3DNode<float>