<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff>I'm not familiar with Tcl and I don't know
if it has a Round method, but you can make one yourself:</FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT color=#0000ff>float</FONT> j = (number);</DIV>
<DIV><FONT color=#0000ff>int</FONT> i = j;<FONT
color=#008000> </FONT><FONT
color=#008000>// making i equal to the floor of (number)</FONT></DIV>
<DIV><FONT color=#0000ff>if</FONT> (j-i>=0.5) i=i+1;</DIV></BLOCKQUOTE><FONT
face=Arial color=#0000ff></FONT>
<DIV><FONT face=Arial color=#0000ff size=2>Hope to have been of
help!</FONT><BR><BR></DIV>
<P><!--table border=0 cellpadding=0 cellspacing=0 align=left width=100%>
                        <tr>
                                        <td align=left--><A href="http://www.inegi.up.pt"><IMG
src="http://inegi.inegi.up.pt/varios/assinatura2/individual/612.jpg"
border=0></A> <!--/td>
                        </tr>
                </table--></P>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=fcukered@gmail.com href="mailto:fcukered@gmail.com">Ali</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=pgoncalves@inegi.up.pt
href="mailto:pgoncalves@inegi.up.pt">Patrícia Gonçalves</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, July 18, 2006 7:33
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] Float to
Int</DIV>
<DIV><BR></DIV>Hi, i'm using tcl/tk and not C++. I'm fairly new to
tcl/tk, do you know <BR>the syntax?<BR><BR>Thanks.<BR><BR>Patrícia Gonçalves
wrote:<BR><BR>> Hi!<BR>> <BR>> I'm not sure I understood your
problem...<BR>> <BR>> I imagine you have something like
this:<BR>><BR>> float j =
0.8983f;<BR>> int i = (int)j;<BR>><BR>>
making i=0.<BR>> <BR>> If you're using .NET you can use the
Math::Round method:<BR>><BR>> float j =
0.8983f;<BR>> int i =
(int)Math::Round(j);<BR>><BR>> making i=1.<BR>> <BR>> Hope
this helps!<BR>> <<A
href="http://www.inegi.up.pt">http://www.inegi.up.pt</A>><BR>><BR>><BR>><BR>>
----- Original Message -----<BR>> *From:* Ali
Calvert <<A
href="mailto:fcukered@gmail.com">mailto:fcukered@gmail.com</A>><BR>>
*To:* <A href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> <<A
href="mailto:vtkusers@vtk.org">mailto:vtkusers@vtk.org</A>><BR>>
*Sent:* Tuesday, July 18, 2006 5:33 PM<BR>>
*Subject:* [vtkusers] Float to Int<BR>><BR>> Hi
all, i'm having a bit of difficulty converting my
texture<BR>> coordinates (as a float from 0 ->
1) to a coordinate (as an<BR>> integer from 0 -
> size of image) My current method simply
floors<BR>> the float, i.e. 0.8983 would be a 0,
however this isn't very<BR>> accurate as it should
be a 1.<BR>> <BR>>
Can anybody help me please?<BR>>
<BR>> Also if there is a better way of doing this
rather than rounding,<BR>> i would appreciate any
comments.<BR>>
<BR>> Thank you for your
time.<BR>><BR><BR></BLOCKQUOTE></BODY></HTML>