Re: A Matlab question on Patch



"Shariful " <bluepearlb@xxxxxxxxx> wrote in message
<g4veqt$r55$1@xxxxxxxxxxxxxxxxxx>...
Hi, Thanks for your email. I am new to matlab GUI. Let's do
the easier one first. I have got 2 axes (Name: axesL and
axesR) where 2 real-head models get loaded. I have made 4
push-buttons (for each) to rotate the model. Would you
please write few line code (for a button) to rotate the
patch in some direction, please. Thanks

roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson) wrote in
message <g4tgoj$srm$1@xxxxxxxxxxxxxxxxxxxxxxx>...
In article <g4sod9$8df$1@xxxxxxxxxxxxxxxxxx>,
Shariful <bluepearlb@xxxxxxxxx> wrote:

I am working on a Matlab GUI. I was able to load a patch (a
human brain) into one axes of my figure. Now I would like
to rotate the patch in various direction, change its
transparency, color etc.

Does the patch have to be rotated relative to other
objects that
are to be kept fixed in place, or is it okay if the entire
viewpoint changes (corresponding to changing the direction
you are looking at the scene)? Rotating the entire scene is
relatively easy, by changing the axes Camera* parameters;
rotating
the patch while keeping other things unchanged is more work.

For transparency and color, I suggest that you go into the
matlab
doc and ask it to search on
patch properties

--
amazon.com's top 8 books about "walter" are Kotzwinkle/
Gundy/ Colman's
"Walter the Farting Dog"



What is a real-head model? Are you talking about actual
matlab patches made using the patch command, or images made
using the image or imshow commands? It seems suspicious that
you would have a "patch of a human brain" or do you mean a
3-D model made out of patches?

But anyway, here is a function i wrote for a 3-D rotation
button, which is very similar to the built in 3-D rotation
button on the figure toolbar: (this is the callback of a
togglebutton that you push on/off to enable/disable
rotation.) It should be pretty obvious how to modify this
for your gui...


function GUIrotate3d(hObject,eventdata)


handles=guidata(gcf);

%do 3d rotation for active graph.

if get(hObject,'value')

%start rotate3d mode:

handles.rotater=rotate3d(handles.activegraph);
set(handles.rotater,'enable','on');

%ban all axes from rotating:
allaxes=findobj(gcf,'type','axes');

setAllowAxesRotate(handles.rotater,allaxes,false);

%allow active graph to rotate:

setAllowAxesRotate(handles.rotater,handles.activegraph,true);

else
%turn off 3d rotation:
if isa(handles.rotater,'graphics.rotate3d')
set(handles.rotater,'enable','off')
end

end

.



Relevant Pages

  • Re: Principal Axes of Orthogonal Column Vector set?
    ... I needed to find that rotation. ... rotation in one pair of axes, ... If you search the centroid, this is just the mean-vector: ... where a strict orthogonality was not required. ...
    (sci.math)
  • Re: [PATCH v2] input: mt: Interface and MT_TOOL documentation updates
    ... If panning and pinching and rotation could all be recovered properly, ... Here is an example for you: You sit in a car. ... The synaptics driver patch sent recently contains an example event stream ... send a patch. ...
    (Linux-Kernel)
  • Re: 3D mouse rotation
    ... > axis. ... After including a visual representation of the camera axes on-screen, ... rotation, there is no residual rotation around the Z ...
    (comp.graphics.api.opengl)
  • Re: describing angular velocity in three dimensions around a single axis
    ... Imagine a body with an orthogonal axes set at it's centre of mass. ... as a single angular velocity around a seperate axis going through the ... I understand that the orientations of this new axis will be ... a finite time-step aka Euler's method of describing any rotation in 3D ...
    (sci.physics)
  • Re: Axis of rotation
    ... Two of those axes are stable, ... and trying to rotate the book through the unstable axis ... will cause wobble while the other two axes allow stable rotation. ... against the tiny perturbations that will inevitably occur in practice? ...
    (sci.physics)