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);
view(3)
light

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)

Comments

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




Published with MATLAB® R2017b

|
  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.