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

elevation_filter(display) Display elevation_filter(display)

NAME

elevation_filter - generate scalar values from point projection onto a line.

DESCRIPTION

The elevation_filter object takes as input a display_data object and generates on output scalar data based on the projection of the points onto a line (i.e., up_vector). The original geometry and other information is passed through the filter, only the scalar data is modified.

A common use of the elevation_filter is to color geometry based on its elevation. For example, a display_data representing terrain (i.e., x-y array of polygons with z displacements corresponding to altitude) can be processed by elevation_filter using the up-vector (0,0,1) to give typical map coloring. However, since the up_vector is an instance variable, it is possible to generate scalar data based on an arbitrary direction.

SUPERCLASS

display_filter

INSTANCE VARIABLES

up_vector the direction used to project points against to generate scalar data. Points further along (i.e., in the positive direction) of the up_vector are assigned a larger scalar value than those further back. By default up_vector=(0,0,1).

range specifies the (min,max) range that scalar values are mapped into. By default range=(0,1).

MESSAGES

up_vector= (x,y,z) set the value of the up_vector (i.e., projection vector)

up_vector? get the value of up_vector

range? get the current range.

range= (min,max) set the current range.

EXAMPLE

In this example a display data is created consisting of points. An elevation_filter is used to assign scalar values to the points. Then using the data primitive, spheres are placed at each point.

/*

* Script to test elevation filter */ display_data new: dd points=( 0,0,0, .1,0,3, 0,.1,2, .1,.1,-1 ) ; elevation_filter new: ef data_in= dd up_vector=(1,1,1) range=(10,99) ; sphere_modeller new: sm debugon! resolution=2 radius =0.25 ; data_primitive new: dp debugon! data_in= ef source= sm ; display_all new: da data_in= dp range=[ef range?] ; actor new: a modeller=da ;

camera new: acamera on! position=(1,1,1) x_range=(-2,2) y_range=(-2,2) z_range=(-2,2) default! ; renderer new: aren actors=[actor instances?] cameras=acamera render! ;

SEE ALSO

display_data, display_filter, display_modeller, modeller


Please send comments and suggestions to
consult@rpi.edu