File Exchange Pick of the Week

Our best user submissions

Fruit Package

Jiro‘s pick this week is A simple fruit package by kim9091.

This one is a fun and well-written example of 3D graphics using basic patch objects. You can draw 13 different kinds of fruits with ability to specify geometric parameters. For example, here’s a strawberry.

s = fruit.strawberry([0 0 0], 5);

To change the orientation, you simply use the rotate function.

rotate(s,[0 1 0],-45)

Let’s place a slice of lemon on the side.

l = fruit.lemon([5 8 0],10);
rotate(l,[1 0 0],-45)

Now, enjoy your fruit plate! (from the FEX entry)


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

Published with MATLAB® R2017b

  • print


要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。