<> <> <> DIRECTORY Controls, Imager, Matrix3d, ThreeDBasics, Vector3d; Animate3d: CEDAR DEFINITIONS ~ BEGIN <> CameraMode: TYPE ~ {local, global}; CameraProc: TYPE ~ PROC [control: Control, data: REF ANY]; Camera: TYPE ~ REF CameraRec; CameraRec: TYPE ~ RECORD [ data: REF ANY _ NIL, -- client data proc: CameraProc _ NIL, -- client proc called when camera changed view: Matrix _ NIL, -- tranformed matrix by viewport matrix: Matrix _ NIL, -- camera matrix fieldOfView: Control _ NIL, -- field of view zDistance: Control _ NIL, -- distance of eye along negative z-axis x: Control _ NIL, -- x coordinate of origin y: Control _ NIL, -- y coordinate of origin z: Control _ NIL, -- z coordinate of origin xGlobal: Control _ NIL, -- rotation about global x-axis yGlobal: Control _ NIL, -- rotation about global y-axis zGlobal: Control _ NIL, -- rotation about global z-axis xLocal: Control _ NIL, -- rotation about local x-axis yLocal: Control _ NIL, -- rotation about local y-axis zLocal: Control _ NIL, -- rotation about local z-axis xMove: Control _ NIL, -- x-translation yMove: Control _ NIL, -- y-translation zMove: Control _ NIL, -- z-translation scale: Control _ NIL, -- scale about local origin hScreen: Control _ NIL, -- horizontal screen translation vScreen: Control _ NIL, -- vertical screen translation lastMoused: Control _ NIL -- last control moused ]; ViewPort: TYPE ~ RECORD [xo, yo: INTEGER, xs, ys: REAL]; Hold: TYPE ~ REF HoldRec; HoldRec: TYPE ~ RECORD [lng, lat, mag, x, y, z: Control _ NIL]; <> Triple: TYPE ~ Vector3d.Triple; TripleSequence: TYPE ~ Vector3d.TripleSequence; Pair: TYPE ~ Vector3d.Pair; PairSequence: TYPE ~ Vector3d.PairSequence; Matrix: TYPE ~ Matrix3d.Matrix; Context: TYPE ~ Imager.Context; Viewer: TYPE ~ Animate.Viewer; Mouse: TYPE ~ Animate.Mouse; Control: TYPE ~ Animate.Control; ControlProc: TYPE ~ Animate.ControlProc; ControlType: TYPE ~ Animate.ControlType; ControlList: TYPE ~ Animate.ControlList; Context3d: TYPE ~ REF ThreeDBasics.Context; xAxis: Triple ~ Vector3d.xAxis; yAxis: Triple ~ Vector3d.yAxis; zAxis: Triple ~ Vector3d.zAxis; <> InitCamera: PROC [ origin: Triple _ [0.0, 0.0, 0.0], globalRotate: Triple _ [0.0, 0.0, 0.0], localRotate: Triple _ [0.0, 0.0, 0.0], move: Triple _ [0.0, 0.0, 0.0], scale: REAL _ 1.0, fieldOfView: REAL _ 0.0, zDistance: REAL _ 10.0, screenMove: Pair _ [0.0, 0.0], proc: CameraProc _ NIL, data: REF ANY _ NIL] RETURNS [Camera]; <> <<>> ComputeNewMatrix: PUBLIC PROC [ origin: Triple _ [0.0, 0.0, 0.0], rotate: Triple _ [0.0, 0.0, 0.0], move: Triple _ [0.0, 0.0, 0.0], scale: REAL _ 0.0, fieldOfView: REAL _ 0.0, zDistance: REAL _ 0.0, m: Matrix _ NIL] RETURNS [Matrix]; <> <<>> InitContext: PROC [context: Context, camera: Camera, in: Matrix _ NIL] RETURNS [Matrix]; <> <<>> UpdateCamera: PROC [camera: Camera]; <> <> <> <> <<>> UpdateGlobalRotates: PROC [camera: Camera, rotates: Triple]; <> <<>> UpdateLocalRotates: PROC [camera: Camera, rotates: Triple]; <> <<>> UpdateOrigin: PROC [camera: Camera, origin: Triple]; <> <<>> UpdateMove: PROC [camera: Camera, move: Triple]; <> <<>> UpdateFieldOfView: PROC [camera: Camera, fieldOfView: REAL]; <> <<>> UpdateScale: PROC [camera: Camera, scale: REAL]; <> <<>> UpdateScreen: PROC [camera: Camera, screen: Pair]; <> <<>> UpdateZDistance: PROC [camera: Camera, zDistance: REAL]; <> <<>> GetCameraMatrix: PROC [camera: Camera] RETURNS [Matrix]; <> <<>> GetViewMatrix: PROC [camera: Camera, context: Context] RETURNS [Matrix]; <> <<>> GetViewPort: PROC [context: Context] RETURNS [ViewPort]; <> <<>> TransformByViewPort: PROC [in: Matrix, context: Context, out: Matrix _ NIL] RETURNS [Matrix]; <> <<>> SetContext3dView: PROC [context3d: Context3d, camera: Camera]; <> <> <<>> LastAdjustedCamera: PROC RETURNS [Camera]; <> <> InitHold: PROC [proc: ControlProc _ NIL, data: REF ANY _ NIL] RETURNS [Hold]; <> <<>> FocusHold: PROC [vector: Triple, hold: Hold]; <> <> PaintAnimate: PROC [c1, c2, c3, c4, c5, c6: Control _ NIL]; <> <<>> ScreenPick: PROC [points: TripleSequence, pairs: PairSequence, view: Matrix, mouse: Mouse] RETURNS [pointPicked: INTEGER]; <<>> <> <> <<-1 is returned if the length of pairs is less than the length of points.>> <<>> END.