Xpresso: Rounding to whole numbers?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 12 December 2006   #1
Question Xpresso: Rounding to whole numbers?

Hi Gang,

Sorry for the embarrassingly n00bish question but I've got a brick missing in my humble wall of Xpresso knowledge.

Question: Is there a node (or simple way) to round off numbers?

For example: Lets say a node is outputting a value of 878.882 and I want the number to be rounded off to its closest whole number, in this case: 879

Any tips appreciated.

Cheers / Alex
__________________
----------| C4D R17 Studio | Rhino 5 | Zbrush 4 |----------
 
Old 12 December 2006   #2
just plugging your "real" output into an "integer" input (or long) will result in the value being automatically rounded down, you can use the universal converter node to do this if you want to. you can also use the math->FloatFunc node and pick "Floor" to round down to "Ceil" to round up (the result will still be a real "floating point" number rather than an integer).
__________________
The Third Party | Homepage | My Reel
"You need to know what you're doing before you start, and to start because you need what you're doing."
 
Old 12 December 2006   #3
Originally Posted by Per-Anders: just plugging your "real" output into an "integer" input (or long) will result in the value being automatically rounded down, you can use the universal converter node to do this if you want to. you can also use the math->FloatFunc node and pick "Floor" to round down to "Ceil" to round up (the result will still be a real "floating point" number rather than an integer).


Thanks for those useful tips Per!
The math->FloatFunc node worked the best for this particular scene.
Good to learn something new too

Cheers / Alex
__________________
----------| C4D R17 Studio | Rhino 5 | Zbrush 4 |----------
 
Old 12 December 2006   #4
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:56 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.