Code covered by the BSD License  

Highlights from
mouse3d

4.8

4.8 | 5 ratings Rate this file 12 Downloads (last 30 days) File Size: 3.8 KB File ID: #28095

mouse3d

by

 

Easily zoom, pan, rotate the camera in a Matlab axis with left/center/right mouse button

| Watch this File

File Information
Description

This function MOUSE3D enables mouse camera control on an certain figure axes.

Enable mouse control with mouse3d(axis-handle) or just mouse3d

MouseButtons
  Left : Rotate
  Right : Zoom
  Center : Pan
 Keys
  'r' : Change mouse rotation from inplane to outplane
  'i' : Go back to initial view

Example,
   [X,Y,Z] = peaks(30);
   surf(X,Y,Z)
   colormap hsv
   % Enable mouse control
   mouse3d

MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
15 May 2014 simba forrest

very nice!

note to turn off rotate3d before calling mouse3d.

22 Jan 2012 Ioannis Filippidis

Very nice tool, the centered rotation works well when zoomed in, compared to the default MATLAB rotation tool.

09 Aug 2011 Janos Marki

Excellent tool, Matlab should be shot for not having implemented this on their own years ago. Good work, Dirk-Jan!

15 Nov 2010 YT

I think this is the tool what I need exactly!
But I found if the code in line 187 was changed to:
Rz=[cosd(r(3)) sind(r(3)) 0 0; -sind(r(3)) cosd(r(3)) 0 0; 0 0 1 0; 0 0 0 1];
the rotate will be better.
One more thing, could the function that use mouse wheel to zoom be added to the tool? :-)

05 Nov 2010 Yuanming Suo

This is really cool.

Contact us