DIRECTORY G3dBasic, G3dShape, ImagerColor, Rope, TiogaOps, ViewerOps; G3dLight: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; Triple: TYPE ~ G3dBasic.Triple; Shape: TYPE ~ G3dShape.Shape; RGB: TYPE ~ ImagerColor.RGB; IlluminationProc: TYPE ~ PROC [light: Light, position: Triple] RETURNS [color: RGB]; Light: TYPE ~ REF LightRep; LightRep: TYPE ~ RECORD [ type: ATOM _ NIL, -- type of light name: ROPE _ NIL, -- name of light position: Triple _ [200.0, 100.0, 100.0], -- position of the light eyePosition: Triple _ [0.0, 0.0, 0.0], -- eyespace position of the light color: RGB _ [0.7, 0.7, 0.7], -- color of light direction: Triple _ [0.8, 0.4, 0.4], -- unitd position of light illuminationProc: IlluminationProc _ NIL, -- illumination due to this light highlight: Triple _ [], -- highlight direction a, b, f, eDotH: REAL _ 0.0, -- shading accelerators shape: Shape _ NIL, -- if this light isn't round privateData: REF ANY -- data for this type of light ]; LightSequence: TYPE ~ REF LightSequenceRep; LightSequenceRep: TYPE ~ RECORD [ length: CARDINAL _ 0, ambient: RGB _ [0.7, 0.7, 0.7], -- ambient light level shadowDarken: REAL _ 0.1, -- amount to darken shadowed element: SEQUENCE maxLength: CARDINAL OF Light ]; Error: SIGNAL [code: ATOM, reason: ROPE]; -- we're able to resume this error PrepareLights: PROC [lights: LightSequence, eyeView: Triple] RETURNS [LightSequence]; PrepareLight: PROC [light: Light, eyeView: Triple]; LightDots: PROC [light: Light, normal, eyeView: Triple] RETURNS [nDotE, nDotH, nDotL: REAL]; SpecularFromDots: PROC [light: Light, nDotE, nDotH, nDotL: REAL] RETURNS [REAL]; LengthenLightSequence: PROC [lights: LightSequence] RETURNS [LightSequence]; AddToLightSequence: PROC [ lights: LightSequence, light: Light, eyeView: Triple _ []] RETURNS [LightSequence]; DeleteLight: PROC [lights: LightSequence, name: ROPE]; RegisterLightType: PROC [light: Light, type: ATOM]; GetLightType: PROC [type: ATOM] RETURNS [light: Light]; InitStandardLightClasses: PROC; RopeFromLights: PROC [lights: LightSequence] RETURNS [ROPE]; AnnotateLightsToViewer: PROC [lights: LightSequence, viewerName: ROPE]; END. vG3dLight.mesa Copyright c 1988 by Xerox Corporation. All rights reserved. Bloomenthal, July 21, 1989 2:38:18 pm PDT Crow, May 16, 1989 5:38:45 pm PDT Type Declarations; Errors Lighting Prepare the lights (set various accelerators, and so on) for ray tracing. Prepare a single light. Return lighting information. Return specular lighting information. Lengthen the sequence of lights. Add the light to the sequence. If eyeView # [0.0, 0.0, 0.0] then prepare the lights. Delete the named light from the lights sequence. Registration Add class to list of registered ShadingClasses, for fancy texturing procs, etc. Retrieve registered class for use or modification. Register default light classes. Miscellany Return a rope describing the lights. If the named viewer exists, append to it a description of the lights; otherwise, create the viewer and write the description. ΚT˜™ Jšœ Οmœ1™Jšœžœ žœžœ˜3J˜——š ™Jš Οnœžœžœ žœ‘"˜P—š ™š’ œžœ)žœ˜UJ™IJ™—š’ œžœ!˜3J™J™—š’ œžœ(˜7Jšžœžœ˜$J™J™—š ’œžœ%žœžœžœ˜PJ™%J™—š’œžœžœ˜LK™ K™—š’œžœ˜K˜K˜ K˜Kšžœ˜K™UK™—š’ œžœžœ˜6K™0——š  ™ defaultš’œžœžœ˜3J™P—š’ œžœžœžœ˜7J™2J™—š’œžœ˜J™——š  ™ š’œžœžœžœ˜