Resending from a different mail account: something's wrong with my normal one.
I had sent this on Friday (and the next one I'm about to send again).
I am still new to OpenDX and I am having trouble figuring out how to
get my data to display the way I want. Please bear with my possibly
ignorant inquiries.
What I have is a scattering of points in 3D. I want to display the
points as glyphs colored base on the elevation, the z coordinate of
the point position. But I can't figure out how to access the
locations z coordinate since it is a position and not one of the
'fields'.
-steve
Your terminology is slightly off. The "field" is the basic object in
DX, and generally contains "components" such as "positions" and
"data".
So, I think you want to get at the Z values of the "positions"
component. (Unfortunately, mathematicians and physicists commonly
refer to this as the Z-component of this 3-vector. Oh well.)
So, before you create the glyphs, insert a Mark module and
Mark("positions"). This means the "positions" are copied into the
"data" component. Then add a Compute(a.z). This rips out the
Z-component and makes it the "data". Then Autocolor. This operates on
the "data" values.
At this point the field has a "colors" component corresponding to the
Z values of the "positions" component, but, the original "data" has
been moved into "saved data" and so cannot be used to size the glyphs
you are about to make.
You have several options, of which I'll describe only 2.
1. You don't care about the old "data" values, and glyphing according
to the Z-values is fine. In that case, just Glyph and Image and
you're done.
2. You really want to glyph according to the old data but want to
color by the Z-values. In this case, you need to recover the "saved
data" into the "data" before Glyph sees it. I find this simple trick
the easiest: after the Autocolor, Unmark("junk"), then
Remove("junk"). Seems silly, but it has the effect of pushing the
Z-values into a "junk" variable then deleting it (removing is not
absolutely necessary but I run a clean net.) The side effect of
Unmark is that "saved data" is put back into "data". You cannot
simply Unmark (the default value is equal to the preceding Mark, thus
you would be doing Unmark("positions") because you will overwrite
your 3D positions with only the Z-values which is not a good idea if
you plan to visualize a 3D point cloud.
--
Chris Pelkie
Scientific Visualization Producer
618 Rhodes Hall Cornell Theory Center, Cornell University
Ithaca, NY 14853