|
From: Hans-Bernhard B. <br...@ph...> - 2003-12-15 18:26:29
|
On Sun, 14 Dec 2003, Daniel J Sebald wrote:
> I don't have time to modify and test a quick fix for the colorbox.
I did one and put it into CVS.
It works as announced in my original reply: it places the color box in
exactly the position it has in default 'set view' settings, regardless of
what the current view settings are. This could have been done by
resetting the view matrix to default, but I chose a more blunt way: ran
the existing code in a debugger to step through map3d_xy when called from
the colorbox generator, and wrote down the position of the color box in
"view coordinates". It's really a quick and dirty fix, but like all such,
it works ;-)
Daniel: your thoughts about xleft and friends are only partly right.
The actual mapping for 3D plots does *not* actually use those. It
uses the variables xscaler, xmiddle, yscaler and ymiddle, instead, so
the actual code snippet I inserted looks like this:
cb_x_from = xmiddle + 0.709 * xscaler;
cb_x_to = xmiddle + 0.778 * xscaler;
cb_y_from = ymiddle - 0.147 * yscaler;
cb_y_to = ymiddle + 0.497 * yscaler;
The constants are what I ripped out of that debugger session, the rest is
the expected mapping from view coordinates to terminal coordinates, as
used by map3d_xy() and the TERMCOORD() macro in util3d.
Some other parts of the 3D plotting engine (outputting the title and key,
e.g.) do use xleft and friends, but that's because they work directly in
2D, neglecting the whole 3D stuff.
--
Hans-Bernhard Broeker (br...@ph...)
Even if all the snow were burnt, ashes would remain.
|