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

texture_map_cut_planes(texture)Texturetexture_map_cut_planes(texture)

NAME

texture_map_cut_planes - generate texture coordinates to make multiple planar cuts

DESCRIPTION

The texture_map_cut_planes object takes as input a display_data object that must contain points. Each point is assigned a texture coordinate by calculating its distance to a series of cut planes. The cut planes are defined using the points and normals of a source display data. A special texture map exits for use with this object in: textures/cut.texture.map. Also, the boolean_texture object will generate appropriate textures for cutting.

SUPERCLASS

display_filter

INSTANCE VARIABLES

source is the name of a display data object that contains points and normals to be used as cut planes.

scale_factor is a scale factor used to scale the distances from the planes. The resulting texture coordinates may be outside the 0 to 1 interval. If so, the texture will repeat unless repeat_off! is sent to the texture instance being used by the actor.

MESSAGES

EXAMPLE

/* Illustrate the texture_map_cut_planes display data filter */ /* In: scripts/texture/texture_map_cut_planes.scr */

/* Create two spheres */ sphere_modeller new: asphere radius=10 resolution=4;

sphere_modeller new: anothersphere radius=5 resolution=4;

/* Define 3 cut planes */ display_data new: planes points= (0,0,0, 0,0,0, 0,0,0) normals=(0,1,0, 1,0,0, 1,1,1) ;

/* Define the cutting filter */ texture_map_cut_planes new: cutter source=planes

data_in=asphere scale_factor=1 ;

/* We need a display all for each model */ display_all new: da data_in=cutter; display_all new: da2 data_in=anothersphere;

/* The textures to do cutting */ <boolean_texture.scr /* texture new: atexture file=`cut.texture.map' read! repeat_off! linear_interpolate_off! ; */ /* And two actors, one for each model */ property new: metal color=(1,.3882,.2784) specular_color=(1,1,1) specular_power=20 specular=.8 diffuse=.6 ;

actor new: anactor property= metal texture=case_10 modeller=da;

actor new: anotheractor scale=(.8,.8,.8) color=(1,1,0) modeller=da2;

/* Render the actors */ renderer new: aren actors=(anotheractor, anactor) render!;

/* A cue to spin the camera */ cue new: spin duration=1000 tick_actions=` aren_c1 azimuth:5; aren_l1 position=[aren_c1 position?] focal_point=[aren_c1 focal_point?]; ' ;

/* A scene for spinning */

scene new: ascene cues=spin renderers=aren;

SEE ALSO

display_feature, display_filter, data_geometry, display_data, texture_map_to_plane, actor, texture_map_cut_quadric, texture, boolean_texture


Please send comments and suggestions to
consult@rpi.edu