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

texture_map_stereographic(display)Texturetexture_map_stereographic(display)

NAME

texture_map_stereographic - generate texture coordinates based on latitude / longitude

DESCRIPTION

The texture_map_stereographic object generates texture coordinates for points by converting x,y,z into latitude / longitude and then orthogonally projecting northern and southern hemispheres onto a disk of the equator. We assume that the sphere is of radius 1 and is centered at (.5,.5,.5). Thus latitudes are projected onto concentric circles with center (.5,.5) and longitudes are projected onto lines going through the point (.5,.5). Only original texture coordinates that satisfy the relation sqrt((s-.5)^2 + (t-.5)^2) < 0.5 will be used with this scheme of texture mapping.

SUPERCLASS

display_filter

INSTANCE VARIABLES

center is the x,y,z coordinate of the center of the coordinate system. Default is (0,0,0).

s_range is the range of the first texture coordinate. By increasing the range, the texture is repeated. For example, if s_range=(0,10), the texture will be repeated 10 times. Default is (0,1).

t_range is the range of the second texture coordinate. By increasing the range, the texture is repeated. For example, if t_range=(0,10), the texture will be repeated 10 times. Default is (0,1).

EXAMPLE

/* generate a globe using texture mapping */

/* Create a sphere */ sphere_modeller new: aSphereModel resolution=4;

/* Add texture based on orthogonal projection of the sphere onto its equator * plane */ texture_map_stereographic new: aStereoGraphic data_in=aSphereModel

;

/* A modeller */ display_all new: aSphereDa data_in=astereographic ;

/* World texture */ texture new: worldTexture file=`/home/lishakill/projects/lymb_dev/lymb/textures/nature/earth.texture.map' linear_interpolate_on! read! ;

/* World view up is z axis */ camera new: c1 view_up=(0,0,1) position=(1,0,0) focal_point=(0,0,0) x_range=(-1,1) y_range=(-1,1) z_range=(-1,1) default! on! ;

/* Place light at camera */ light new: sun position=[c1 position?] focal_point=[c1 focal_point?] on!;

/* A cue to spin camera, keeping light at camera */ cue new: spin duration=10 tick_actions=` c1 azimuth:5; sun position=[c1 position?] focal_point=[c1 focal_point?]; ' ;

/* The earth */ actor new: Earth modeller=aSphereDa texture=worldTexture scale=(-1,1,1);

renderer new: aren cameras=c1 lights=sun actors=Earth ;

aren render!;

scene new: ascene cues=spin renderers=aren;

SEE ALSO

display_feature, display_filter, data_geometry, display_data, texture_map_cut_planes, texture_map_to_plane, texture, actor


Please send comments and suggestions to
consult@rpi.edu