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

texture_map_lat_long(display)Texturetexture_map_lat_long(display)

NAME

texture_map_lat_long - generate texture coordinates based on latitude / longitude

DESCRIPTION

The texture_map_lat_long object generates texture coordinates for points by converting x,y,z into latitude / longitude and scaling the results between 0 and 1. The first texture coordinate is longitude, varying from 0 (0 degrees) at the north pole to 1 (180 degrees) at the south pole. The second coordinate is latitude measured from 0 (0 degrees) at the prime meridian to 1 (360 degrees). A texture map of the earth is in: textures/earth.texture.map

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 latitude/longitude */ texture_map_lat_long new: aLatLong data_in=aSphereModel ;

/* A modeller */ display_all new: aSphereDa data_in=alatlong

;

/* 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