Look at Inquire. It can tell you grid dimensions and counts. Then use Computes with integer division and/or modulo and/or floor, ceil, to do what you did in your example.


On May 4, 2005, at 2:40 PM, Matthew Bogosian wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a grid of intensity values which I am displaying using Color/ColorMap:

8.0 + 0.0 0.0 0.0 0.0 0.0
|
7.5 + 0.0 1.0 0.0 1.0 1.0
|
7.0 + 1.0 2.0 1.0 2.0 1.0
| |
y 6.5 + 0.0 1.0 2.0 2.0 2.0
| |
6.0 + 1.0 2.0 2.0 3.0 2.0
|
5.5 + 2.0 3.0 3.0 4.0 3.0
|
5.0 + 2.0 3.0 4.0 5.0 4.0
|
+---+-------+-------+-------+-------+
1.0 1.25 1.5 1.75 2.0
- x -

As you can see, the x positions range linearly from 1.0 to 2.0. The y positions range linearly from 5.0 to 8.0.

When I use a Pick, I can extract the "closest vertex" which would give me an x/y position coordinate (e.g., {1.25 6.5}).

How do I translate this into a zero-based index into each of the x/y positions (e.g., {1.0 5.0} -> {0 0} or {1.25 6.5} -> {1 3})?

Any help is greatly appreciated.

-- Matt

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)

iD8DBQFCeRc7nLpDzL5I7l8RAqINAJ9XzMwCvk5rPoiHEfU89ig/kerTmQCfV/TB
W9nPLdjZr8NeCMsY1PQ7IQc=
=B9xA
-----END PGP SIGNATURE-----


_______________________________
Chris Pelkie
Scientific Visualization Producer
622 Rhodes Hall, Cornell Theory Center
Ithaca, NY 14853 (607) 254-8794

Reply via email to