Results 1 to 7 of 7

Thread: Normalize scalar?

  1. #1

    Normalize scalar?

    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!

  2. #2
    incurable dumbass Medi8or's Avatar
    Join Date
    Mar 2003
    Location
    Norway
    Posts
    803
    Divide node?
    (Divide by the max-huge-number..)
    -

    My dongle is small, hard, and purple.

  3. #3
    Yes I thought of that... Problem is I don't know what is the max value... Anyways I figured out a workaround...

  4. #4
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,543
    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

  5. #5
    Quote Originally Posted by Lightwolf View Post
    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?

  6. #6
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,543
    Quote Originally Posted by Jure View Post
    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

  7. #7
    Quote Originally Posted by Lightwolf View Post
    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!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •