DIRECTORY G3dBasic, G3dShape, ImagerColor, Rope, TiogaOps, ViewerOps; G3dLight: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; Pair: TYPE ~ G3dBasic.Pair; Triple: TYPE ~ G3dBasic.Triple; Shape: TYPE ~ G3dShape.Shape; RGB: TYPE ~ ImagerColor.RGB; LightProc: TYPE ~ PROC [light: Light, position: Triple] RETURNS [color: RGB]; Light: TYPE ~ REF LightRep; LightRep: TYPE ~ RECORD [ name: ROPE ¬ NIL, -- name of light position: Triple ¬ [200.0, 100.0, 100.0], -- position of the light screen: Pair ¬ [0.0, 0.0], -- screen position 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], -- unitized position of light highlight: Triple ¬ [], -- highlight direction a, b, f, eDotH: REAL ¬ 0.0, -- shading accelerators shape: Shape ¬ NIL, -- if this light isn't round radius: REAL ¬ 2.*93000000.*609.344, -- 2x solar distance (meters) exponent: REAL ¬ 2.0, -- for Phong shading lightProc: LightProc ¬ NIL -- compute shade from this 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 drawLights: BOOL ¬ TRUE, element: SEQUENCE maxLength: CARDINAL OF Light ]; Error: SIGNAL [code: ATOM, reason: ROPE]; -- we're able to resume this error LightDots: PROC [light: Light, normal, eyeView: Triple] RETURNS [nDotE, nDotH, nDotL: REAL]; SpecularFromDots: PROC [light: Light, nDotE, nDotH, nDotL: REAL] RETURNS [REAL]; AddLight: PROC [ lights: LightSequence, name: ROPE, position, direction: Triple, color: RGB ¬ [1,1,1], eyeView: Triple ¬ []] RETURNS [LightSequence]; LengthenLightSequence: PROC [lights: LightSequence] RETURNS [LightSequence]; DeleteLight: PROC [lights: LightSequence, name: ROPE]; PrepareLight: PROC [light: Light, eyeView: Triple]; PrepareLights: PROC [lights: LightSequence, eyeView: Triple] RETURNS [LightSequence]; RegisterLight: PROC [light: Light, type: ATOM]; GetRegisteredLight: PROC [type: ATOM] RETURNS [light: Light]; InitDefaultLightClasses: PROC; RopeFromLights: PROC [lights: LightSequence] RETURNS [ROPE]; AnnotateLightsToViewer: PROC [lights: LightSequence, viewerName: ROPE]; END. ς G3dLight.mesa Copyright Σ 1988, 1992 by Xerox Corporation. All rights reserved. Bloomenthal, February 19, 1993 4:31 pm PST Crow, May 16, 1989 5:38:45 pm PDT Type Declarations; Return the color at the 3d position due to the given light. Errors Lighting Return lighting information. Return specular lighting information. Light Sequences Add the light to the sequence. If eyeView # [0.0, 0.0, 0.0] then prepare the lights. Lengthen the sequence of lights. Delete the named light from the lights sequence. Preparation Prepare a single light. Prepare the lights (set various accelerators, and so on) for polygon shading or ray tracing. Registration Add class to list of registered ShadingClasses, for fancy texturing procs, etc. Retrieve registered class for use or modification. Register a 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. Κΐ–"cedarcode" style•NewlineDelimiter ™™ Jšœ Οeœ6™BJ™*J™!J˜JšΟk œ<˜EJ˜—JšΠblœžœž ˜Jšœž˜headšΟlœ™Jšžœžœžœ˜Jšœžœ˜Jšœ žœ˜"Jšœžœ˜ Jšžœžœžœ˜ J˜š œ žœžœ"žœ žœ˜OJ™DJ˜—Jšœ žœžœ ˜šœ žœžœ˜Jšœ žœžœΟc˜-Jšœ/‘˜GJšœ%‘˜7Jšœ-‘!˜NJšœ žœ‘˜7Jšœ,‘˜IJšœ!‘˜7Jšœžœ ‘˜;Jšœžœ‘˜;Jšœ žœ‘˜GJšœ žœ‘˜4Jšœžœ‘ ˜DJ˜J˜—Jšœžœžœ˜,šœžœžœ˜!Jšœžœ˜Jšœžœ‘˜=Jšœžœ ‘˜>Jšœžœžœ˜Jšœžœ žœžœ˜3J˜——š ™Jš Οnœžœžœ žœ‘"˜P—š ™š’ œžœ(˜7Jšžœžœ˜$J™J™—š ’œžœ%žœžœžœ˜PJ™%——š ™š’œžœ˜J˜JšœΟsžœ˜ Jšœ£œ˜Jšœ£ž£œ£œ˜J˜Jšžœ˜J™UJ™—š’œžœžœ˜LJ™ J™—š’ œžœžœ˜6J™0——š  ™ š’ œžœ!˜3J™J™—š’ œžœ)žœ˜UJ™\——š  ™ š’ œžœžœ˜/J™P—š’œžœžœžœ˜=J™2J™—š’œžœ˜J™!——š  ™ š’œžœžœžœ˜