triangle_strip_filter(display)Filtertriangle_strip_filter(display)
NAME
triangle_strip_filter - convert polygons into triangle
strips
DESCRIPTION
Triangle_strip_filter takes as input a display_data object
and converts triangle polygons into triangle strips. The
goal is to improve rendering speed since many renderers
are significantly faster when rendering triangle strips.
Triangle_strip_filter passes lines and non-triangular
polygons through to its output display_data. Previously
existing triangle strips are also passed through. Triangular polygons are merged together into triangle strips.
The length of each triangle strip is variable depending
upon the nature of the data. All point data is passed
through to the output display data.
SUPERCLASS
adjacency_filter
INSTANCE VARIABLES
max_strip_length
the maximum number of triangles in any given triangle strip. If max_strip_length==0, then the strips
are of unlimited length.
MESSAGES
max_strip_length= value
set the maximum strip length.
max_strip_length?
get the maximum strip length.
generate_data!
create triangle strips from input data.
EXAMPLE
/*
* Create display data (in the form of a "+" consisting of lines,
* triangle strips, and polygons.
*/
display_data new: dd
points=(
1,0,0,
2,0,0,
0,1,0,
1,1,0,
2,1,0,
3,1,0,
0,2,0,
1,2,0,
2,2,0,
3,2,0,
1,3,0,
2,3,0
)
polygons=(
3,1,2,4,
3,4,2,5,
4,3,4,8,7,
3,4,5,8,
3,5,8,9,
3,6,9,10,
3,9,11,12,
3,8,11,9
)
lines=(
2,2,6,
4,1,3,7,11
)
triangle_strips=(
3,5,9,6
)
;
/*
* Create triangle strips from the polygons
*/
triangle_strip_filter new: ts
data_in= dd
output!
;
SEE ALSO
adjacency_filter, display_filter, display_data
Please send comments and suggestions toconsult@rpi.edu