Shan-Ho Tsai:
|I am trying to plot a number of cubes in a three dimensional
|space. My data file contains 13 columns, where the first 3
|columns correspond to the x, y, and z coordinates of the
|position of each cube, column 4 is the volume of each cube,
|and the remaining 9 columns are the x,y, and z components
|of the vectors normal to the 3 surfaces of the cubes.
|
|I am using ImportSpreadsheet and so far I have been able to
|use cubic glyphs for a scalar data (volume of the cube) and
|plot the cubes with the correct sizes, and in the correct
|positions.
|
|But how can I have the cubes orient in the correct direction
|according to the 3 normal vectors?
Well, Transform/Rotate affect the glyph orientation, but to have separate
transforms per glyph you're going to need separate fields per cube. If
you're going to do that you might just want to use quads/polygons.
You can pre-build a polygons or quads field with all of the pretransformed
data, write it in DX native format, and import that of course.
If however you want to use DX, you might need to do a ForEach and Construct
to build your axis aligned cubes with the right cuberoot(volume) dimensions
at the origin, use Transform( inverse matrix of axis vectors ) to rotate it
into place, and then Translate and Inquire("apply transform"). Store all
these in a group using SetLocal/GetLocal/Append and you're ready to go.
I have an InvertMatrix macro I can mail you if you're interested, which
will save you some time building your rotation matrix. Doing matrix
inversion with a DX network is a bit dain bramaged, but I've been there
before. ;-)
Randy
--
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA N127-01; RTP, NC 27711