|
From: James R. V. Z. <jr...@co...> - 2009-07-26 02:28:40
|
Ethan Merritt wrote:
>On Thursday 23 July 2009 19:12:56 James R. Van Zandt wrote:
>
>> I revised plot3d.c to fix the X and Y limits before checking for valid
>> Z values:
...
>>
>> It works here. However, I'd appreciate someone with a better
>> understanding of the code checking for side effects.
>
>I don't know if it counts as a side-effect, but after setting
>
> set view equal xyz
>
>the 3D zoom behavior (control + mouse wheel) is unexpected.
>I would have expected the whole plot to get bigger or smaller;
>instead the x/y area remains fixed, the x and y scales change,
>and the z axis grows correspondingly longer or shorter.
>
>Note: since 'set view equal xyz' doesn't work in the x11 terminal anyhow,
>you would need to use the wxt or maybe qt terminal to see what I'm describing.
I'm not familiar with "set view equal xyz", but it seems to do
*something* here, in the x11 terminal. E.g., provided I start with a
square window, these commands:
set parametric
set view equal xyz
set view 58,228
set hidden3d
set isosamples 30,30
set vrange [-pi:pi]
set urange [-2:2]
set xrange [-2:2]
set yrange [-1.5:1.5]
set ticslevel .2
splot cos(u)+.5*cos(u)*cos(v),.5*sin(v),sin(u)+.5*sin(u)*cos(v)
will plot with equal screen distance per axis distance for all three
axes. (With a rectangular window, the vertical scaling is off. Is
that the bug you're referring to? If so, then maybe it should be
mentioned in the docs?)
Assuming that's what it's supposed to do, then I believe the
control-wheel is handling the X and Y axes correctly. Perhaps it
should scale the Z the same way (i.e. the figure grows, but parts
outside the plot range don't get drawn). However, I wasn't able to
implement Z scaling. I did include some code that used alt-wheel to
scroll up in Z. However, it's commented out* because do_zoom() and
apply_zoom() don't implement anything for Z, and I didn't understand
the logic well enough to modify them. (Feel free to delete that part
if you think it clutters the code.)
At least, control-wheel does maintain the relative scaling.
- Jim Van Zandt
* actually it's conditional on DO_ZOOM_AND_APPLY_ZOOM_FIXED_TO_HANDLE_Z_AXIS.
|