|
From: Hans-Bernhard B. <br...@ph...> - 2003-12-12 18:52:09
|
On Fri, 12 Dec 2003, Petr Mikulik wrote:
> Colorbox should stay at that position where it is for the default view.
Then it mustn't be output in terms of data coordinates, but in "view
coordinates" or even directly in screen coordinates. The difference
between the two is the matrix multiplication carried out by functions
map3d_xy() and map3d_xyz() in util3d.c.
So you would have to avoid calling either of those (or referring to
trans_mat, for that matter) in draw_color_smooth_box().
A little background: 3D plots have four distinct coordinate systems, not
just the three we expose to the user in the 2D case:
first/second (i.e. data coordinates)
graph
screen
In 3D, the processing goes like this:
data points ---- (ranges, map_x3d() & friend) ----> normalized coordinates
normalized coordinates (set view, map3d_xyz()) ---> view coordinates
view coordinates ----> ([xy]scaler, [xy]middle) ---> terminal coordinates
Of these, the "normalized" most closely match the 2D "graph" coordinates,
and terminal coordinates are essentially the same as "screen". View
coordinates fall somewhere between those.
For reference, the results in default 'set view' for the corners of the
colour box are:
res = {0.70899346400575247, -0.14693375672974057, 2.1484375602010033,
6.1537877952320801e-313}
res = {0.77827549630850756, 0.49701905283832915, 2.1484375602010033,
6.1537877952320801e-313}
(It's the first two coordinates only, in each case, that count).
Apply scaler and middle and use those as cb_{x|y}_{from|to}, and you
should be in business.
--
Hans-Bernhard Broeker (br...@ph...)
Even if all the snow were burnt, ashes would remain.
|