V3:
PROC [n, d:
ROPE, t: Triple]
RETURNS [r: Controls.Request] ~ {
r ¬ [
IO.PutFLR["%g (now [%g, %g, %g])",
LIST[IO.rope[n],IO.real[t.x],IO.real[t.y],IO.real[t.z]]], d];
};
V2:
PROC [n, d:
ROPE, n0, n1:
NAT]
RETURNS [r: Controls.Request] ~ {
r ¬ [IO.PutFR["%g (now [%g, %g])", IO.rope[n], IO.int[n0], IO.int[n1]], d];
};
V:
PROC [title, doc:
ROPE, value:
REAL]
RETURNS [Controls.Request] ~ {
RETURN[[IO.PutFR["%g (now %g)", IO.rope[title], IO.real[value]], doc]];
};
SELECT Controls.PopUpRequest[["Ray Trace Options"],
LIST[
-- 1 -- ["Reset", "Reset pixel start location to [0, 0]"],
-- 2 -- V2["Pixel location", "Change pixel location", r.nextPixel.x, r.nextPixel.y],
-- 3 -- ["Ray Mode", "Change ray mode"],
-- 4 -- V2["Image width and height", "Change image width and height", r.w, r.h],
-- 5 -- V3["Eye Point", "Change location of eyepoint", r.eyePoint],
-- 6 -- V3["Eye View", "Change direction of eye view", r.eyeView],
-- 7 -- V3["Up Direction", "Change direction of up", r.upDirection],
-- 8 -- V["Field Of View", "Change image field of view", r.fieldOfView],
-- 9 -- ["Lighting", "Change lighting"],
-- 10 -- ["Set specular portion of model"],
-- 11 -- ["RAY TRACE"]]]
FROM
1 => G3dRayTrace.ResetRayTracing[r];
2 => r.nextPixel ¬ Controls.GetIntegerPair[ts, "Pixel location: ", r.nextPixel];
3 =>
SELECT Controls.PopUpRequest[["Mode"],
LIST[
Controls.BoolRequest[r.jitter, "Jitter"],
Controls.BoolRequest[r.noShading, "No Shading"],
["Set Pixel Sub-sampling"],
["Set Adaptive Limit"]]]
FROM
1 => r.jitter ¬ NOT r.jitter;
2 => r.noShading ¬ NOT r.noShading;
3 => r.nPixelSamples ¬ Controls.GetNat[ts, "# sub-samples", r.nPixelSamples];
4 => r.adaptiveLimit ¬ Controls.GetNat[ts, "adapt limit", r.adaptiveLimit];
ENDCASE;
4 => {
i: Controls.IntegerPair ¬ Controls.GetIntegerPair[ts, "Width, Height: ", [r.w, r.h]];
r.w ¬ i.x;
r.h ¬ i.y;
G3dRayTrace.ResetRayTracing[r];
};
5 => r.eyePoint ¬ Controls.GetTriple[ts, "EyePoint", r.eyePoint];
6 => r.eyeView ¬ Controls.GetTriple[ts, "EyeView", r.eyeView];
7 => r.upDirection ¬ Controls.GetTriple[ts, "UpDirection", r.upDirection];
8 => r.fieldOfView ¬ Controls.GetReal[ts, "FOV", r.fieldOfView];
9 => r.lights ¬ G3dTool.LightOptions[r.lights, r.eyeView, ts];
10 => r.portionSpecular ¬ Controls.GetReal[ts, "specular: ", r.portionSpecular];
11 => rayTraceProc[clientData];
ENDCASE;