{"id":2754,"date":"2011-05-13T14:03:48","date_gmt":"2011-05-13T14:03:48","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2011\/05\/13\/oblique-projection\/"},"modified":"2011-05-13T14:03:48","modified_gmt":"2011-05-13T14:03:48","slug":"oblique-projection","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2011\/05\/13\/oblique-projection\/","title":{"rendered":"Oblique Projection"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\">Jiro<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/30891-obliqueview\"><tt>obliqueview<\/tt><\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/111917\">John Barber<\/a>.\r\n   <\/p>\r\n   <p>As some of you may know from my previous posts, one of my MATLAB interests is in graphics. While you can very easily create\r\n      plots using built in functions, <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011a\/techdoc\/\/creating_plots\/f7-20419.html\">Handle Graphics<\/a> opens up a whole new world of visualization. You can customize pretty much anything about a MATLAB plot using Handle Graphics.\r\n      So when I received a question about creating a plot with an <a href=\"http:\/\/en.wikipedia.org\/wiki\/Oblique_projection\">oblique projection<\/a>, it piqued my interest. It turns out that this is tricky to do, because MATLAB projection types are either <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011a\/techdoc\/\/visualize\/f4-22650.html\">orthographic or perspective<\/a>.\r\n   <\/p>\r\n   <p>When I saw John's <tt>obliqueview<\/tt>, 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):\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_obliqueview\/obliqueview_example_before.png\"> <\/p>\r\n   <p>By running his function, you can make it look like this:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_obliqueview\/obliqueview_example_after.png\"> <\/p>\r\n   <p>His clever method involves applying a shear transformation to the plot objects, which creates an oblique projection when view\r\n      in 2D. His function is very well written, with lots of comments and detailed help. To get the full effect, use this in conjunction\r\n      with his other entry, <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/30018-oaxes-central-axis-lines-through-an-origin\"><tt>oaxes<\/tt><\/a>.\r\n   <\/p>\r\n   <p><b>Comments<\/b><\/p>\r\n   <p>Give this a try and let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2754#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/30891-obliqueview#comments\">comment<\/a> for John.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_ddb12ffd1b8b44dea9d322fdf6318600() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='ddb12ffd1b8b44dea9d322fdf6318600 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' ddb12ffd1b8b44dea9d322fdf6318600';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Jiro Doke';\r\n        copyright = 'Copyright 2011 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_ddb12ffd1b8b44dea9d322fdf6318600()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.12<br><\/p>\r\n<\/div>\r\n<!--\r\nddb12ffd1b8b44dea9d322fdf6318600 ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\r\n% Jiro>'s pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/30891-obliqueview |obliqueview|>\r\n% by <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/111917\r\n% John Barber>.\r\n%\r\n% As some of you may know from my previous posts, one of my MATLAB\r\n% interests is in graphics. While you can very easily create plots using\r\n% built in functions,\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2011a\/techdoc\/\/creating_plots\/f7-20419.html\r\n% Handle Graphics> opens up a whole new world of visualization. You can\r\n% customize pretty much anything about a MATLAB plot using Handle Graphics.\r\n% So when I received a question about creating a plot with an\r\n% <http:\/\/en.wikipedia.org\/wiki\/Oblique_projection oblique projection>, it\r\n% piqued my interest. It turns out that this is tricky to do, because\r\n% MATLAB projection types are either\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2011a\/techdoc\/\/visualize\/f4-22650.html\r\n% orthographic or perspective>.\r\n%\r\n% When I saw John's |obliqueview|, I was eager to see how he did it. Let's\r\n% say that you create a plot that looks like this (from the HELP for his\r\n% function):\r\n%\r\n% <<obliqueview_example_before.png>>\r\n%\r\n% By running his function, you can make it look like this:\r\n%\r\n% <<obliqueview_example_after.png>>\r\n%\r\n% His clever method involves applying a shear transformation to the plot\r\n% objects, which creates an oblique projection when view in 2D. His\r\n% function is very well written, with lots of comments and detailed help.\r\n% To get the full effect, use this in conjunction with his other entry,\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/30018-oaxes-central-axis-lines-through-an-origin |oaxes|>.\r\n% \r\n% *Comments*\r\n%\r\n% Give this a try and let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2754#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/30891-obliqueview#comments\r\n% comment> for John.\r\n\r\n##### SOURCE END ##### ddb12ffd1b8b44dea9d322fdf6318600\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   Jiro's pick this week is obliqueview by John Barber.\r\n   \r\n   As some of you may know from my previous posts, one of my MATLAB interests is in graphics. While you can very easily create\r\n     ... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2011\/05\/13\/oblique-projection\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2754"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2754"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2754\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}