Node Input Type Conversion

From Planetside Software Wiki
Jump to: navigation, search

Terragen is pretty flexible about what can be used for input to nodes. Particularly in the case of function nodes, nodes are designed to handle a particular type. For example the "Multiply scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values." nodeA single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene. is designed to work with scalars, and the "Multiply colour" nodeA single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene. is designed to work with colours. You can however use a nodeA single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene. for input which is sending a different type for its output, i.e. you can connect a "Multiply scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values." nodeA single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene. to an input of the "Multiply colour" nodeA single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene. and you will still get a result.

Terragen does this through a process known as type conversion, also known as type casting. Type conversion can convert a vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. into a scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values., or a scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values. into a colour and so on. If you input a colour into a nodeA single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene. expecting a scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values., the input colour will be converted to a scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.. Here is a list of the type conversion rules Terragen uses :


Vector to colour
When converting a vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. to a colour, a piecewise component copy is done :

colour.red becomes vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..x
colour.green becomes vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..y
colour.blue becomes vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..z


Colour to vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank.
When converting a colour to a vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank., a piecewise component copy is done :

vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..x becomes colour.red
vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..y becomes colour.green
vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..z becomes colour.blue


Vector to scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.
When converting a vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. to a scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values., the scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values. is set to the magnitude of the vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. using the following formula:

scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values. becomes square root of ( vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..x x vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..x + vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..y x vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..y + vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..z x vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..z )


Scalar to vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank.
When converting a scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values. to a vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank., each component of the vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. is simply set to the value of the scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values. :

vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..x becomes scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.
vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..y becomes scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.
vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank..z becomes scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.


Scalar to colour
When converting a scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values. to a colour, each component of the colour is simply set to the value of the scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values. :

colour.red becomes scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.
colour.green becomes scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.
colour.blue becomes scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.


Colour to scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.
When converting a colour to a scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values., the scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values. is set to the luminanceThis is essentially the brightness of the colour. TG2 converts RGB colours to greyscale by taking the luminance of the colour. value of the colour :

scalarA scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values. becomes luminanceThis is essentially the brightness of the colour. TG2 converts RGB colours to greyscale by taking the luminance of the colour. of colour


Back to Network View Guide