File Exchange Pick of the Week

May 13th, 2011

Oblique Projection

Jiro's pick this week is obliqueview by John Barber.

As some of you may know from my previous posts, one of my MATLAB interests is in graphics. While you can very easily create plots using built in functions, Handle Graphics opens up a whole new world of visualization. You can customize pretty much anything about a MATLAB plot using Handle Graphics. So when I received a question about creating a plot with an oblique projection, it piqued my interest. It turns out that this is tricky to do, because MATLAB projection types are either orthographic or perspective.

When I saw John's obliqueview, I was eager to see how he did it. Let's say that you create a plot that looks like this (from the HELP for his function):

By running his function, you can make it look like this:

His clever method involves applying a shear transformation to the plot objects, which creates an oblique projection when view in 2D. His function is very well written, with lots of comments and detailed help. To get the full effect, use this in conjunction with his other entry, oaxes.

Comments

Give this a try and let us know what you think here or leave a comment for John.


Get the MATLAB code

Published with MATLAB® 7.12

One Response to “Oblique Projection”

  1. ashwani replied on :

    i have an image clicked from bottom in which the square looks like quadrilateral. how to correct the same to make it square again. the affine transformation in not correcting it fully.

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.