DIRECTORY Atom, G3dRender, Rope; G3dMappedAndSolidTexture: CEDAR DEFINITIONS ~ BEGIN PropList: TYPE ~ Atom.PropList; LORA: TYPE ~ LIST OF REF ANY; Context: TYPE ~ G3dRender.Context; Pair: TYPE ~ G3dRender.Pair; Patch: TYPE ~ G3dRender.Patch; SpotProc: TYPE ~ G3dRender.SpotProc; TextureMap: TYPE ~ G3dRender.TextureMap; TextureFunction: TYPE ~ G3dRender.TextureFunction; ROPE: TYPE ~ Rope.ROPE; AddSolidTexture: PROC [context: Context, shapeName: ROPE, name: ATOM]; AddMappedTexture: PROC [context: Context, shapeName: ROPE, texture: REF TextureMap]; SumAllMappedTextures: PROC [context: Context, shapeName: ROPE]; RemoveAllTexture: PROC [context: Context, shapeName: ROPE]; AdjustTexture: PROC [poly: REF Patch, texture: LORA, txtrRange: Pair]; GetTxtrAt: SpotProc; RegisterTextureFunction: PROC [name: ATOM, proc: SpotProc, props: PropList _ NIL]; GetRegisteredTextureFunction: PROC [name: ATOM] RETURNS[txtrFn: TextureFunction]; Chaos: PROC [x, y, z: REAL] RETURNS [REAL]; Noise: PROC [vx, vy, vz: REAL] RETURNS [REAL]; ScaleTxtrCoords: PROC [context: Context, shapeName: ROPE, scale, xRatio, yRatio: REAL _ 1.0]; SetPatchTextureCoords: PROC [ context: Context, shapeName: ROPE, corner0: Pair _ [0.,0.], corner1: Pair _ [0.,1.], corner2: Pair _ [1.,1.], corner3: Pair _ [1.,0.] ]; MakeTxtrCoordsFromVtxNos: PROC [ context: Context, shapeName: ROPE, vtcesInRow, numberOfRows: NAT, row0col0, rowNcol0, rowNcolM, row0colM: Pair]; MakeTxtrCoordsFromNormals: PROC [ context: Context, shapeName: ROPE, botLeft: Pair _ [0.0, 0.0], topLeft: Pair _ [0.0, 1.0], topRight: Pair _ [1.0, 1.0], botRight: Pair _ [1.0, 0.0], sw: Pair _ [180.0, -90.0], nw: Pair _ [180.0, 90.0], ne: Pair _ [-180.0, 90.0], se: Pair _ [-180.0, -90.0]]; TextureFromAIS: PROC [ context: Context, fileName: ROPE, type: ATOM _ $Intensity, factor: REAL _ 1.0] RETURNS[texture: REF TextureMap]; SumTexture: PROC [texture: REF TextureMap]; END. (G3dMappedAndSolidTexture.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Last Edited by: Crow, May 4, 1989 6:58:55 pm PDT Perlin, August 5, 1985 0:23:18 am PDT Basic Types Procedures for Controlling Texture Allows client to pass name of solid texturing procedure for shape as an ATOM. Sets up supplied texture map. Converts texture maps to summed area table form for antialiasing. Deletes all texture references for object. Support Procedures for setting up texture for tiler Adjusts mapped texture coordinates to avoid coordinate wraparound. Procedures for Evaluating Texture at a Spot Layers textures from a list to onto a pixel. Procedures for solid texture calculation Registers a procedure for computing on a spot (usually for solid textures). Returns a previously registered procedure. A function built on noise, used in some solid texture functions. Perlin's noise function. Fills space with random blobs. Procedures for Computing Texture Coordinates Scale texture coordinates of vertices. xRatio, etc. can be used to set scale assymetrically. eg. texture.x _ texture.x * scale * xRatio. Accumulated scale factor is stored on shape shadingProps list ($TextureScale). Sets all quadrilateral patches with the given texture coordinates at the corners, inner control points on Bezier patches are interpolated from the input corner values For objects which are rectangular polygon grids pulled into a surface shape, eg. surfaces of revolution, this maps a texture onto the rectangular grid. This takes the surface normals and maps from spherical coordinates into a rectangular texture. botLeft, topLeft, etc. allow mapping multiple, or skewed, instances of the texture onto the rectangle. longMin, longMax, etc. allow the area affected to be limited to a certain range of sperical coordinates. Procedures for Reading and Preparing Texture Files Reads AIS file and converts it to texture map form. Factor is for scaling, (height of bump map - default 1, other uses may come). Turn texture map into Summed Table form for anti-aliased texture. ΚŒ˜™Jšœ Οmœ1™