Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

XVOL-AVS-FIELD-FROM-FILE

source files: xvol.[ch]

SYNTAX

(XVOL-READ-AVS-FIELD-FROM-FILE
  :FILENAME <string:filename>
[ :RESULT-IN <grl> ]
)

DESCRIPTION

This function started as a special-case hack to read Loyd's red-green-blue-depth range images into Skandha4 and is slowly evolving into a general utility to load arbitrary AVS fields. At present it is really only intended to read Bharath's computed-image and computed-coords files from AVS, but should in fact be capable of reading arbitrary byte or float fields files -- provided they have labels. (If they don't, you'll either see the components given strange default labels, or else get an error.)

# AVS field file (@(#)write_field.c	8.1.1.1 Stellar 93/05/12)
# creation date: Thu May 11 15:38:02 1995
#
ndim=2				# number of dimensions in the field
dim1=160     			# dimension of axis 1
dim2=220     			# dimension of axis 2
nspace=3			# number of physical coordinates per point
veclen=4			# number of components at each point
data=byte        		# native format of sg
field=uniform     		# field type (uniform, rectilinear, irregular)
label= red green blue  

The result is a graphic relation with :PIXEL-RED, :PIXEL-GREEN and :PIXEL-BLUE image planes, suitable for drawing as usual, plus a :PIXEL-DEPTH plane recording the depth of the visible surface in machine coordinates.

The machine coordinates corresponding to the image are passed through as :MIN-X/:MAX-X, :MIN-Y/:MAX-Y, :MIN-Z/:MAX-Z float properties on the graphic relation: These differ from the original machine coordinates in that the X-MIN, X-MAX, Z-MIN and Z-MAX coordinates have been negated, and the Y-MIN and Y-MAX coordinates have been interchanged, in order to produce a standard Skandha left-handed coordinate system. (Attempting to do overlay graphics and such in a coordinate system in which some axes run the reverse direction is inconvenient in Skandha4: It tends to introduce unwanted mirrorings in the graphics pipeline.)


Go to the first, previous, next, last section, table of contents.