<<>> <> <> <> DIRECTORY CedarProcess, G3dBasic, G3dLight, G3dMatrix, G3dView, Imager, ImagerColor, ImagerPixel, ImagerSample, IO, Rope, ViewerClasses; G3dRayTrace: CEDAR DEFINITIONS ~ BEGIN <> Process: TYPE ~ CedarProcess.Process; PixelMap: TYPE ~ ImagerPixel.PixelMap; SampleMap: TYPE ~ ImagerSample.SampleMap; Ray: TYPE ~ G3dBasic.Ray; IntegerPair: TYPE ~ G3dBasic.IntegerPair; Triple: TYPE ~ G3dBasic.Triple; LightSequence: TYPE ~ G3dLight.LightSequence; Matrix: TYPE ~ G3dMatrix.Matrix; Viewport: TYPE ~ G3dMatrix.Viewport; Context: TYPE ~ Imager.Context; RGB: TYPE ~ ImagerColor.RGB; ROPE: TYPE ~ Rope.ROPE; origin: Triple ~ G3dBasic.origin; yAxis: Triple ~ G3dBasic.yAxis; zAxis: Triple ~ G3dBasic.zAxis; <> ClientProc: TYPE ~ PROC [clientData: REF ANY]; RayProc: TYPE ~ PROC [ray: Ray, clientData: REF ANY] RETURNS [rgb: RGB]; RayData: TYPE ~ REF RayDataRep; RayDataRep: TYPE ~ RECORD [ <> nextPixel: IntegerPair ¬ [0, 0], -- the next pixel to ray-trace <> eyePoint: Triple ¬ origin, -- base of ray eyeView: Triple ¬ zAxis, -- direction of ray upDirection: Triple ¬ yAxis, -- up orientation fieldOfView: REAL ¬ 40.0, -- angle for half screen <> lights: LightSequence ¬ NIL, -- sequence of lights <> portionSpecular: REAL ¬ 0.5, -- portion of specularity <> x, y: NAT ¬ 0, -- origin of image (in pixels) w, h: NAT ¬ 80, -- size of image (in pixels) display: PixelMap, -- the color display redo: SampleMap ¬ NIL, -- used for adaptive sampling <> clientData: REF ANY ¬ NIL, -- passed to in rayProc finishProc: ClientProc ¬ NIL, -- called upon completion <> jitter: BOOL ¬ FALSE, -- stochastic ray from pixel center noShading: BOOL ¬ FALSE, -- iff true, show hit-testing only traceOctree: BOOL ¬ FALSE, -- iff true, show octree hit-testing nPixelSamples: NAT ¬ 1, -- sub-sampling of pixels adaptiveLimit: NAT ¬ 0 , -- # levels of adaptive refinement rgb: RGB ¬ [0, 0, 0], -- pixel value ray: Ray ¬ [origin, origin], -- the ray rayProc: RayProc ¬ NIL, -- client supplied ray-trace proc process: Process ¬ NIL -- forked process ]; <> RayTrace: PROC [ display: PixelMap, -- place to create the ray-traced image eyePoint: Triple ¬ origin, -- position of the eye eyeView: Triple ¬ zAxis, -- view direction upDirection: Triple ¬ yAxis, -- orientation fieldOfView: REAL ¬ 40.0, -- half horizontal view in degrees jitter: BOOL ¬ FALSE, -- stochastic ray from pixel center nPixelSamples: NAT ¬ 1, -- sub-sampling of pixels adaptiveLimit: NAT ¬ 0, -- # levels of adaptive refinement rayProc: RayProc ¬ NIL, -- client supplied ray-tracing proc clientData: REF ANY ¬ NIL] -- passed to the rayProc RETURNS [RayData]; <> <> <> <<>> StartRayTracing: PROC [r: RayData]; <> <<>> StopRayTracing: PROC [r: RayData]; <> <<>> ResetRayTracing: PROC [r: RayData]; <> <<>> SetNextPixel: PROC [r: RayData]; <> <<>> SetRay: PROC [r: RayData, x, y: NAT]; <> <> AspectRatio: PROC [r: RayData] RETURNS [REAL]; <> <<>> RayImageScreenCorners: PROC [r: RayData] RETURNS [p1, p2, p3, p4: Triple]; <> <<>> DrawRayTip: PROC [context: Context, r: RayData, view: Matrix, viewport: Viewport]; <> DrawRayImageScreen: PROC [context: Context, r: RayData, view: Matrix, viewport: Viewport]; <> ParametersMessage: PROC [r: RayData] RETURNS [rope: ROPE]; <> <<>> END.