[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #44861] Image display in a 3D view
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #44861] Image display in a 3D view |
Date: |
Wed, 22 Apr 2015 08:25:09 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15 |
Follow-up Comment #4, bug #44861 (project octave):
Attached is a changeset that is a step in the direction of the described
behavior for the gnuplot toolkit. Here are some commands to test its
operation:
graphics_toolkit ('gnuplot');
figure;
imgrad = repmat([0:31], 32, 1) + repmat([0:31]', 1, 32);
hi = imagesc(imgrad);
view(3);
get(hi, 'zdatamode')
get(hi, 'zdata')
set(hi, 'zdata', 20);
get(hi, 'zdatamode')
get(hi, 'zdata')
set(hi, 'zdatamode', 'auto');
get(hi, 'zdatamode')
get(hi, 'zdata')
set(hi, 'zdata', [])
I'm not so keen on the idea of the data determining the type of plot, i.e., 2D
or 3D, at such a low level as the data itself. That is, in graphics.cc is a
function calc_dimensions (__calc_dimensions__) which does the following:
else if ((go.isa ("line") || go.isa ("patch") || go.isa ("image"))
&& ! go.get ("zdata").is_empty ())
nd = 3;
Then in the script file __go_draw_axes__.m is the following test:
nd = __calc_dimensions__ (h);
[snip]
if (nd == 2)
plot_cmd = "plot";
else
plot_cmd = "splot";
The reason that is problematic is that "view(2)" and "view(3)" aren't really
what is controlling the plot type when it seems they should be. If one
changes the "zdata" of an image, it affects the plot view if zdata = []. (But
I have forced zdata to be 0 when in "auto" mode, so one has to take the image
out of "auto" mode and then set the value to [].) That seems odd to me. If
someone can think of something more straightforward, we could change that.
It all depends upon how one views things, I guess, i.e., whether a 2D plot is
a different animal than a 3D plot. In some sense it is nice to have 2D plot
just be an orthographic view of a 3D plot, i.e., viewing so that one of the
axes is perpendicular to the view. On the other hand, a 2D plot offers more
control over 3D for key placement, axes labels, etc.
I added a function in graphics.in.h,
void update_zdatamode (void)
{
update_zdata ();
}
but that doesn't get called. I wanted the zdata to go back to the auto data
default when set(hi, 'zdatamode', 'auto').
Modifying graphics.in.h touches so many files in the project, thereby mods
take a long time to recompile.
(file #33737)
_______________________________________________________
Additional Item Attachment:
File name: octave-image_in_3d-djs2015apr22.patch Size:5 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?44861>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/