PDA

View Full Version : Float Number display issue


IkerCLoN
01-21-2008, 12:45 AM
Hi, folks! I'm trying to develop some little tools for creating some facial controls to a character. I'm wondering a nice way to get, via PickPoint function, the index of a vertex, so from there I can build some stuff.

I want to do it, first, in the most simple way (I'm still learning script), so I thought I could use meshOps to get the vertex count, vertex indexes and vertex positions -in an array-, and then using findItem to match the position taken by PickPoint with the desired one, and then getting the vertex index.

But, what happens then? FindItem function does not work right, because as stated in MAX help...

When you display or print a Float, MAXScript prints the value to the 6th significant digit. The following table shows examples of values stored to a MAXScript variable, the value as stored, and the value as displayed.

Input Value / Stored Value / Displayed Value

1.23456789 / 1.23456788 / 1.23457

1.1 / 1.10000002 / 1.1

1.01 / 1.00999999 / 1.01



... so the displayed float number is not the same as the stored one. So the question would be if you know if this could be 'tricked' in some way. I took a look at the preferences and I've found nothing about the decimals displayed, neither in the MAXScript Help File.

Thanks for your time!

IkerCLoN
01-21-2008, 01:32 AM
Hi again! Although I want to know something about the question I did, I found something that works fine for me, and returns the index of the vertex I'm looking for:


vertexNumber = $Teapot01.verts.count
vertsArr = $Teapot01.verts

myPos =
(
for i =1 to vertexNumber collect vertsArr[i].pos as string
)

lookedPos = pickPoint prompt:"Pick a vertex" snap:#3D as string

findItem myPos lookedPos

Bam! It works like a (dirty) charm :)

CGTalk Moderation
01-21-2008, 01:32 AM
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.