PDA

View Full Version : Normalize scalar?



Jure
05-13-2009, 04:48 AM
Is there a way to normalize scalar output of a node?

I have a node which is outputting huge range of numbers and would like to squeeze it between 0 and 1.0 or some other arbitrary values.

Any tip would be appreciated. Thanks!

Medi8or
05-13-2009, 06:14 AM
Divide node?
(Divide by the max-huge-number..)

Jure
05-13-2009, 06:18 AM
Yes I thought of that... Problem is I don't know what is the max value... Anyways I figured out a workaround...

Lightwolf
05-13-2009, 07:43 AM
Do you really want to sequeze 0 to x into the 0 to 1.0 range... or do you just need changing numbers between 0 and 1.0?

In the later case, mod should be your friend (it returns the remainder of dividing A by B, i.e. if you divide A by 10 then the remainder will be anything from 0 to 9, getting into the 0 to 1.0 range is just a division away in that case).

Cheers,
Mike

Jure
06-03-2009, 11:31 AM
Do you really want to sequeze 0 to x into the 0 to 1.0 range... or do you just need changing numbers between 0 and 1.0?

In the later case, mod should be your friend (it returns the remainder of dividing A by B, i.e. if you divide A by 10 then the remainder will be anything from 0 to 9, getting into the 0 to 1.0 range is just a division away in that case).

Cheers,
Mike

No, I realy need to squeeze 0 to x into 0-1 range. Any other clues on how to tackle this?

Lightwolf
06-03-2009, 11:39 AM
No, I realy need to squeeze 0 to x into 0-1 range. Any other clues on how to tackle this?
Without knowing the max value, no, not really.
If you do know it then it's just a division by the max value.

Cheers,
Mike

Jure
06-03-2009, 11:43 AM
Without knowing the max value, no, not really.
If you do know it then it's just a division by the max value.

Cheers,
Mike

right.... thanks for help anyway!