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.
range specifies the (min,max) range that scalar values are mapped into. By default range=(0,1).
up_vector? get the value of up_vector
range? get the current range.
range= (min,max) set the current range.
/*
* 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! ;