pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Mesh

Mesh - 1.0

Luke Endres (fallopiano)

Tags:

Description

This is a remake of bobbo's Mesh program. At one point I had tried to download bobbo's original program, but his hosting server was down. So I made my own version. All credit goes to him. Also, on a side note, as soon as you create at least 2 or 3 'nodes', the FPS drops very noticeably. Is there any way I could get a better FPS rate?

Links

Home Page: http://www.pygame.org/
Source: http://www.mediafire.com/download.php?q2w1udwmcmy

Screenshot


click to view original size

Releases

Mesh - 1.1 - Jun 7, 2009
Mesh - 1.0 - Jun 7, 2009

Pygame.org account Comments

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

June 9, 2009 9:35pm - Luke Endres - nickname: (fallopiano)
wait no im wrong :D if you look at bobbo's http://www.pygame.org/project/749/, how do you think that he was able to keep every line anti-aliased?
June 7, 2009 9:48pm - Luke Endres - nickname: (fallopiano)
actually, you are drawing everything every frame. I added a file called options.py, which contains some vars (2 as of now. anti_aliased, and rand_colors). I added some code to make it recognize those vars, and then i turned random_colors on. Everytime that the user clicks. it changes the color to a (rand1-255,rand1-255,rand1-255) color. Once i did that, the color of each line changes every frame. I'll upload a new version.
June 7, 2009 9:37pm - Ian Mallett - nickname: (geometrian)
LOL "cannot convert float infinity to long" :D
The antialiased thing can't really be helped, unless you draw everything every frame.
June 7, 2009 8:59pm - Luke Endres - nickname: (fallopiano)
I actually did use your code :) It was nice and clean so I decided to use it. In fact, when I first started this whole pygame thing, I used your base code to start out my projects.

But ya thanks ALOT. Credit will be given. I was getting like, 25 FPS before... now im about ~650 :D

Two more problem :) If you switch the rendering of the lines to anti aliased, and then you add a bunch of nodes, the anti aliased 'effect', if you will, of the lines drawn a while ago will actually ware away! Also, when I hid the window window's task bar, I got around 10,000 FPS and then python crashes, saying: "line 82, in main
print "FPS = "+str(int(round( Clock.get_fps() )))+str(" -- Dots: ")+str(len(Dot_List))
OverflowError: cannot convert float infinity to long"

:s but ya thanks alot for the help!
June 7, 2009 8:03pm - Ian Mallett - nickname: (geometrian)
Code style looks A LOT like mine--did you use my basecode (http://geometrian.com/Programs/Tutorials/PyGame%20Program%20Shell.py) perchance? XD

Suggestions: Change line 79 to a continue, not a break. Then, move DotInRange(), line 98, to line 72--that way, it will only try to add lines when it needs to. You can also use Psyco to improve that even more. Another thing, because the dots and lines are static, you can just draw them on the screen--you don't have to redraw them every frame. Making these changes helps A LOT :D

Here's my version, with other minor changes: http://pastebin.com/d7981fedb. Here's a screenshot of the modified version in action. Note the framerate and dot number: http://img19.imageshack.us/img19/2742/dots.png.
June 7, 2009 7:17pm - Luke Endres - nickname: (fallopiano)
oops! sorry. I meant to say 'Is there any way I could get a better FPS rate?'
June 7, 2009 7:00pm - pymike - nickname: (pymike)
clock = pygame.time.Clock()

(in loop)
clock.tick(optional_framerate)
clock.get_fps()
spotlight

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


Aug 19, 2014

Aug 18, 2014

Aug 2, 2014


Jul 28, 2014

Jul 22, 2014

Jul 21, 2014

Jul 20, 2014

Jul 19, 2014

Jul 15, 2014

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