Author Topic: Help with splitting and combining numbers in a function  (Read 5700 times)

Hi all,

I am currently working on a material and have a reason to implement a function to control a couple of parameters but the documentation for the function nodes is patchy at best and missing in some places.

There are two things I would like to be able to do but am having little success in achieving:

1) Get two variables (int or float) and combine them into an integer2 or float2 as appropriate.

2) Take an integer2 (or float2) and extract the x and y components as integers (or floats as appropriate).

Any ideas?

Also I would be grateful if sombody could explain the "Sequence" node to me as there appears to be no explicit documentation for it that I can find either in the application or in the manual.

EvilNoodle

Edit: So it seems that I can combine two basic values into a vector using the Vector nodes like "Vector Float 2" and feeding in the In and Last values but I am still at a loss as to how to split values out of a vector.
Last Edit: January 07, 2014, 12:35:41 am

Quote
2) Take an integer2 (or float2) and extract the x and y components as integers (or floats as appropriate).

Use the swizzle nodes. If you only want to extract one float component, the Swizzle Float1 is the one you are interested in.

Quote
Also I would be grateful if sombody could explain the "Sequence" node  to me

This node guarantees that its input are computed in order, from top to bottom. It returns the result of the bottom input. This is useful if your function need to initialize variables in a given order.

Hi,

Thanks a lot for that!

Don't know how I missed that.

Cheers

EvilNoodle