direction_filter(display) Display direction_filter(display)
NAME
direction_filter - generate scalar values based on projection of vector values onto specified direction.
DESCRIPTION
The direction_filter object takes as input a display_data
object and generates on output scalar data based on the
projection of the velocity vector onto a specified direction. The original geometry and other information is
passed through the filter, only the scalar data is modified.
A common use of the direction_filter is to color objects
based on the direction they are moving. For example,
given a group of spheres moving in various direction, they
can be colored based on whether the spheres are moving
"up" or "down". Of course the definition of up or down is
provided by the direction instance variable.
SUPERCLASS
display_filter
INSTANCE VARIABLES
direction
the vector used to project the point velocity
against to generate scalar data. Points moving
with the highest velocity along the direction vector will have the highest scalar values. By
default direction=(0,0,1).
range
specifies the (min,max) range that scalar values
are mapped into. By default range=(0,1).
MESSAGES
direction= (x,y,z)
set the value of the direction (i.e., projection
vector)
direction?
get the value of direction
range? get the current range.
range= (min,max)
set the current range.
EXAMPLE
In this example a display data is created consisting of
points and vector values. An direction_filter is used to
assign scalar values to the points. Then using the data
primitive, spheres are placed at each point and colored
appropriately.
/*
* Script to test direction filter
*/
display_data new: dd
points=(
.1,.1,-1,
0,0,0,
0,.1,2,
.1,0,5
)
vectors=(
0,0,1,
.1,.5,.8,
.4,0,-.7,
0,0,-2
)
;
direction_filter new: df
data_in= dd
direction=(0,0,1)
range=(10,99)
;
sphere_modeller new: sm
debugon!
resolution=2
radius =0.10
;
data_primitive new: dp
debugon!
data_in= df
source= sm
scaling_off!
;
display_all new: da
data_in= dp
range=[df range?]
;
actor new: a
modeller=da
;
camera new: acamera
on!
position=(1,0,0)
x_range=(-5,5)
y_range=(-5,5)
z_range=(-5,5)
default!
;
renderer new: aren
actors=[actor instances?]
cameras=acamera
render!
;
SEE ALSO
display_data, display_filter, display_modeller, modeller
Please send comments and suggestions toconsult@rpi.edu