RE: [SDK]Double to long in c++ ?

Date : Thu, 7 Jun 2007 14:23:23 -0400
To : <XSI(at)Softimage.COM>
From : "Luc-Eric Rousseau" <lucer(at)Softimage.COM>
Subject : RE: [SDK]Double to long in c++ ?
the trick to add 0.25 may not be necessary in this case, but the reason why I suggest using it is for field rendering.  In  field rendering, the frame number in xsi will be 1.0, 1.5, 2.0, 2.5, etc.   If you round to nearest frame with +0.25, you'll end up with frame numbers 1, 1, 2, 2.   If you use +0.5, you'll end up with frame numbers 1,2,2,3.  In other words +0.25 rounds down each field time to the frame number.


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Kim Aldis
Posted At: Thursday, June 07, 2007 1:51 PM
Posted To: xsi
Conversation: [SDK]Double to long in c++ ?
Subject: RE: [SDK]Double to long in c++ ?

 

(LONG)( 1.6 + 0.25) => 1                                                      

 

(LONG)(1.6 + 0.5) => 2

 

The correct round of 1.6 is 2, so adding 0.25 gives an incorrect round. Surely?

 


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.