Capítulo 440 de 859
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
| Signature |
|---|
| `new Object3DNode( scope : 'position' |
Properties
| Property | Description |
|---|---|
.object3d : Object3D | The 3D object. |
| `.scope : 'position' | 'viewPosition' |
.uniformNode : UniformNode | Holds the value of the node as a uniform. |
.updateType : string | Overwritten since this type of node is updated per object. |
Methods
| Method | Description |
|---|---|
.generate( builder : NodeBuilder ) : string | Generates the code snippet of the uniform node. The node type of the uniform node also depends on the selected scope. |
| `.generateNodeType() : 'mat4' | 'vec3' |
.update( frame : NodeFrame ) | Updates the uniform value depending on the scope. |