[vtkusers] Float to Int

Ali Calvert fcukered at gmail.com
Tue Jul 18 12:33:33 EDT 2006


Hi all, i'm having a bit of difficulty converting my texture coordinates (as
a float from 0 -> 1) to a coordinate (as an integer from 0 - > size of
image)  My current method simply floors the float, i.e. 0.8983 would be a 0,
however this isn't very accurate as it should be a 1.

Can anybody help me please?

Also if there is a better way of doing this rather than rounding, i would
appreciate any comments.

Thank you for your time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060718/418fec7a/attachment.htm>


More information about the vtkusers mailing list