File Exchange Pick of the Week

November 12th, 2010

Moving 3D Objects Interactively

Jiro's pick this week is "Moving 3D Objects with Mouse" by Gang Wang.

I like this demo entry, because it shows you how you can interactively manipulate graphics object in MATLAB. Visualization is one of MATLAB's strengths, but not many people know that you can create interactive visualizations as well. The key is to make use of some of the callback functionalities, such as WindowButtonMotionFcn for a figure. Take a look at the subfunction "movit" in Gang's code. That's where all the magic happens.

I would also like to give mention to the 2D version (by Anders) that Gang was inspired by.

Comments

Let us know what you think here or leave a comment for Gang.


Get the MATLAB code

Published with MATLAB® 7.11

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


MathWorks

Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

These postings are the author's and don't necessarily represent the opinions of The MathWorks.