MoveInOrbit:
PUBLIC
PROC[eyePt, lookingAt, axis: Triple,
displayProc:
PROC[eyePt, lookingAt: Triple],
framesPerRev, numFrames:
NAT, startAt:
NAT ← 0
] ~ {
theta: REAL ← 360. / framesPerRev;
currentEyePt: Triple;
FOR i:
NAT
IN [startAt .. startAt+numFrames)
DO
currentEyePt ← Matrix3d.Transform[
eyePt,
Matrix3d.MakeRotate[
axis: Vector3d.Sub[axis, lookingAt],
theta: theta * i,
base: lookingAt
]
];
Call display procedure
displayProc[ [currentEyePt.x, currentEyePt.y, currentEyePt.z], lookingAt ];
ENDLOOP;
};
MoveOnLine:
PUBLIC
PROC[eyePt, lookingAt, toEyePt, toLookingAt: Triple,
displayProc:
PROC[eyePt, lookingAt: Triple],
numFrames:
NAT, startAt:
NAT ← 0
] ~ {
currentEyePt, currentLookingAt: Triple;
FOR i:
NAT
IN [startAt .. startAt+numFrames)
DO
currentEyePt.x ← eyePt.x + (toEyePt.x - eyePt.x) * i / (numFrames-1);
currentEyePt.y ← eyePt.y + (toEyePt.y - eyePt.y) * i / (numFrames-1);
currentEyePt.z ← eyePt.z + (toEyePt.z - eyePt.z) * i / (numFrames-1);
currentLookingAt.x ← lookingAt.x + (toLookingAt.x - lookingAt.x) * i / (numFrames-1);
currentLookingAt.y ← lookingAt.y + (toLookingAt.y - lookingAt.y) * i / (numFrames-1);
currentLookingAt.z ← lookingAt.z + (toLookingAt.z - lookingAt.z) * i / (numFrames-1);
displayProc[currentEyePt, currentLookingAt];
ENDLOOP;
};
MoveOnCurve:
PUBLIC
PROC[eyePts, lookingAts:
LIST
OF Triple,
displayProc:
PROC[eyePt, lookingAt: Triple],
numFrames:
NAT, startAt:
NAT ← 0
] ~ {
currentEyePt, currentLookingAt: Triple ← [0., 0., 0.];
FOR i:
NAT
IN [startAt .. startAt+numFrames)
DO
Evaluate curve !!!!!!!
displayProc[currentEyePt, currentLookingAt];
ENDLOOP;
};