MATLAB Community

MATLAB, community & more

Flying Pumpkins, Dancing Pumpkins

Eric Ludlam likes pumpkins. That might surprise you when you see what he does to them. Example: give him a perfectly good Rumbo pumpkin and he might attach it to a siege engine and fling it a quarter of a mile. At the end of this exercise, Eric is happy, but the pumpkin can no longer be described as "perfectly good." So we can say that what Eric likes to do with pumpkins is make them move. He does this physically with a ballista and virtually in MATLAB. Are you intrigued yet? I am. It's a heck of a story.

For the past 20 years, Eric has been a member of Team Tormentum, a group that specializes in flinging pumpkins long distances. This skill, in low demand most of the year, becomes extremely valuable during the Punkin Chunkin, a competition devoted to, well, flinging pumpkins long distances. It's one of those activities that might baffle you right up to the moment when you witness it. Then you say, "Oh. I see why people do this." There's something strangely gratifying about launching a pumpkin into low earth orbit.

But you didn't come here to learn about pumpkin-flinging siege engines (or if you did, this has been an insanely lucky day for you). You came here to learn something about MATLAB. And Eric can help you there too. In addition to his gourd-hurling responsibilities, Eric is also in charge of the MATLAB graphics team. That means he's the guy who puts the Phong in our lighting models and the handles in our graphics. You may have seen some of his contributions to the ongoing Mini Hack contest. Recently, Eric brought his two loves together. He’s been working on a sophisticated set of pumpkin-rendering tools. You might think of a computer-generated pumpkin as a generic orange blob with a green tuft of a stem on top. But any true aficionado knows there is a wealth of variation in the pumpkin patch. These are all genuine breeds, lovingly portrayed by MATLAB.

You might think that’s impressive enough. But Eric doesn’t stop there. No sir. Just in time for Halloween 2021, he has created a genre-crossing masterpiece. That's right. It's a MATLAB Graphics Dancing Pumpkins music video, complete with original music composed by another MathWorker, Luke Stark.

This paragraph constitutes a dramatic pause. Or the closest thing to it that a blog can provide.

[clears throat] Ladies and gentlemen, it is with great pride and pleasure that I bring you the world premier of "Punkins."

Eric assures me that no pumpkins were harmed in the production of this video (the same cannot be said for his ballista work). Since Eric works in the same building as me, I was able to ask him some questions. Although since there's a pandemic going on, we weren't actually in the same room.

NED. Is Team Tormentum still in business?

ERIC. Team Tormentum is actively waiting for a Punkin Chunkin contest in the Northeastern US to be available for us to attend.  Until then, we play around with launching apples and snowballs in our backyard.

NED. Pumpkin structural integrity is crucial when you're subjecting them to this kind of acceleration. Is pumpkin selection regulated by the judges? Has the Punkin Chunkin led to a breed of small, dense cannonball-like pumpkins?

ERIC. Official World Championship Punkin Chunkin (WCPC) rules regulate which are valid breeds.  Punkins (as we like to call them) must weigh between 8-10 lbs, and breeds that are completely solid (with no hollow core) have been disqualified in the past.  The breed of punkin used differs based on the type of machine.  Hard-throwing torsion machines often like flatter punkins like Rumbo, but air cannons like round lumina punkins.  Our ballista works best with smooth round dense punkins.  Fortunately, most contest organizations know what is needed and provide a nice selection for ammo.

NED. Of the pumpkins pictured in your video, which one would you choose to chunk? And which would you choose to carve into a jack-o-lantern?

ERIC. Of the punkins in the video, luminas are great ammo for our machine.  Jack-o-lanterns usually want a large size with a thinner rind.  Snack Jacks are small, but if you scaled it up, it would make a good carved decoration.

NED. How many polygons in those pumpkins?

ERIC. The pumpkin is made of 2 surface objects.  The body is ~40k quads with interpolated shading, and the stem is 140 quads.

NED. Can our readers get their hands on this pumpkin model?

ERIC. Yes.  It's available on GitHub.

NED. Let's say I wanted to get into the business of modeling vegetables with MATLAB. What tips do you have for me? What primitives did you use for the body and the stem? How did you get those lovely ridges into the pumpkin?

ERIC. For starting out, surf is a great way to start drawing various gourds because it does a nice job displaying 2D matrices which are easy to manipulate in MATLAB.  Next, getting familiar with what the shading, light, lighting, and material commands will help you tune in a particular look for your surface.  I spent quite a bit of time tuning in the material command to get a look I liked for these pumpkins.  If you have more complex shapes with holes in them, using the triangulation object with patch will let you display a wider variety of shapes.

NED. Any other pumpkin-related comments for our readers?

ERIC. If you put a Rumbo punkin on its side and give it a hefty back-spin when throwing it, the ridges generate lift which help it fly farther.  The current record for a torsion catapult using this trick is 3,636ft.

NED. Friends, there's a tip you can use at home tonight! Apply the Magnus effect to your Rumbo to get that half-mile launch you've been dreaming about. Never say the Community Blog doesn't give you practical advice. Thanks for all the good info Eric, and to all of you reading this, a very Happy Halloween!


Guy Rouleau just published an awesome pumpkin-trebuchet piece on his Simulink blog. Check it out!

  • print


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