pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Metaball Funhouse

Metaball Funhouse - 1.0

thomas (tpwrules)

Tags:

Description

An application to render metaballs. I coded this up quickly, but it works. I'm sure the metaball rendering code is not efficient and needs improvement, but it works. Suggestions to make it better are accepted. All one can really use it for is just to play around with it.

controls:

  • q: quit
  • r: start render, cancel render if render in progress
  • d: delete selected metaball

mouse:

  • click anywhere to create a new metaball
  • use the scrollwheel to increase/decrease the size
  • click again to place
  • click on nub in center of a metaball to select it

Links

Home Page: http://www.pygame.org/
Source: http://thomascomputerindustries.com/metaball_funhouse.py.zip

Screenshot


click to view original size

Releases

Metaball Funhouse - 1.0 - Jan 29, 2011

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

January 31, 2011 6:01pm - thomas - nickname: (tpwrules) - 5/5
Thanks for the suggestion, I've uploaded a fixed version. I actually had that bug lingering in my mind but apparently I forgot about fixing it.
January 30, 2011 5:52pm - Hewitt Squared Labs - nickname: (hewitt2labs) - 4/5
For a simple whip-up it looks great. not knowing what metaballs are, the system is pretty simple and easy to understand. when you use the scroll wheel, you can cause this error:
Traceback (most recent call last):
File "metaball_funhouse.py", line 131, in <module>
metaballs[id].render_preview(screen, id == selected_metaball)
File "metaball_funhouse.py", line 22, in render_preview
pygame.draw.circle(surf, (0, 255, 0, 255) if selected else (255, 255, 255, 255), self.pos, self.radius, 2)
ValueError: width greater than radius

I would think of making a simple if statement to check to make sure the radius is big enough, and I'm going to try that.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Jul 23, 2014

Jul 22, 2014

Jul 21, 2014

Jul 20, 2014

Jul 19, 2014

Jul 15, 2014

Jul 10, 2014

Jul 9, 2014

Jun 27, 2014



Jun 24, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)