<<<<<<<<<<<<<<<<

byu_writer(display) Display" byu_writer(display)

NAME

byu_writer - write display data to MOVIE.BYU file

DESCRIPTION

The byu_writer takes as input a display_data object or filter, and writes the data to a MOVIE.BYU file. Becuase the MOVIE.BYU format is not time dependent, only the current data is written.

Byu_writer is capable of automatic filename generation. That is, if the file_prefix is set, and the geometry_file, displacement_file, scalar_file, and tcoord_file instance variables are not set, then these filenames are generated from the file_prefix using the .g, .s,

Byu_writer is capable of writing only general polygons. Lines cannot be written, and triangle strips must be converted to polygons using triangle_filter.

SUPERCLASS

data_writer

INSTANCE VARIABLES

data_in then name of a display_filter or display_data object. Provides the display_data to write out.

file_prefix the prefix name of the MOVIE.BYU file to write. If specified, and other byu files are not named, then file_prefix is used with the appropriate file extensions to generate filenames.

geometry_file explicitly set the geometry filename

displacement_file explicitly set the displacement filename

scalar file explicitly set the scalar filename

tcoord_file explicitly set the texture coordinates file

clobber boolean to control whether the MOVIE.BYU file can be overwritten or not. By default files are overwritten.

MESSAGES

data_in= object_name Set the name of the data_in object.

data_in? Get the name of the data_in object.

file_prefix= filename without extension Set the prefix for MOVIE.BYU files.

file_prefix? Get the file prefix for MOVIE.BYU files.

write! Write the display data out to the MOVIE.BYU files.

write_data: Sets the file prefix and then write out the display data.

geometry_file= filename Set the MOVIE.BYU geometry filename.

geometry_file? Get the MOVIE.BYU geometry filename.

displacement_file= filename Set the MOVIE.BYU displacement filename.

displacement_file? Get the MOVIE.BYU displacement filename.

scalar_file= filename Set the MOVIE.BYU scalar filename.

scalar_file? Get the MOVIE.BYU scalar filename.

tcoord_file= filename Set the MOVIE.BYU texture coordinates filename.

tcoord_file? Get the MOVIE.BYU texture coordinates filename.

EXAMPLE

/* * Test the byu_writer */ display_data new: dd points=( 0,0,0, 1,0,0, 1,1,0, 0,1,0, 0,0,1,

1,0,1, 1,1,1, 0,1,1 ) polygons=( 4,1,2,3,4, 4,1,2,6,5, 4,2,3,7,6, 4,3,4,8,7, 4,4,1,5,8, 4,5,6,7,8 ) scalars=( 10, 20, 30, 40, 50, 60, 70, 80 ) vectors=( 10,11,12, 20,21,22, 30,31,32, 40,41,42, 50,51,52, 60,61,62, 70,71,72, 80,81,82 ) texture_coords=( 0,0, .1,0, .1,.1, 0,.1, 0,0, .1,0, .1,.1, 0,.1 ) ; /* * If the geometry_file, scalar_file, displacement_file, and * tcoords_file are not specified (and the filename is - from either * the "write_file:" or "filename=" messages), then these filenames * are generated automatically from the filename with the ".g", ".s", * ".d", and ".t" extensions. */

byu_writer new: write_byu data_in=dd write_data: `byu_data'

; /* * Now read it back in */ byu new: abyu geometry_file=`byu_data.g' scalar_file=`byu_data.s' displacement_file=`byu_data.d' tcoord_file=`byu_data.t' scale_factor=0.0 ; actor new: a modeller=abyu ; renderer new: aren actors=[actor instances?] render! ;

SEE ALSO

byu, cdf_display_data_writer, display_data, display_filter, triangle_filter


Please send comments and suggestions to
consult@rpi.edu