Cage opened this issue on Dec 20, 2006 · 1232 posts
Spanki posted Mon, 15 January 2007 at 12:14 AM
I found the code, but unfortunately didn't jot down the url where I found the answer. Anyway, just for the curious, here's the C code:
<pre style="border-right:#000000 1px solid;padding-right:2mm;border-top:#000000 1px solid;padding-left:2mm;padding-bottom:2mm;margin:2mm;border-left:#000000 1px solid;padding-top:2mm;border-bottom:#000000 1px solid;background-color:#aefe50;">
Real sign(Real n)
{
if( n > 0.0 )
return 1.0;
if( n < 0.0 )
return -1.0;
return 0.0;
}
Real TrimDecimal(Real num, Real digits)
{
Real n;
n = num * Pow(10.0, digits);
n = sign(n) * Abs(Floor(n + 0.5));
return n / Pow(10.0, digits);
}
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.