Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>After doing homework (a.k.a. research) and trying to directly convert the Java code reference posted on the question into Python, and having a very, very sad experience while trying to have Python/Numpy update a humongous array of pixel colors based on their positions for the rippling of the ripple effect (sorry, my first language isn't English), thus parsing several (x,y) positions for each pass of the effect calculations and blitting that onto the displayed surface on the screen (surfarray ensues), I've come to the conclusion - that is backed up by other commenters - that Pygame simply <strong>won't</strong> be powerful enough to actually traverse that entire array of pixels and apply results of calculations onto every pixel on the screen at a minimum rate of 24 fps (for a less-than-average experience).</p> <p>Quoting the very developer behind <a href="http://www.cs.unm.edu/~imallett/site/" rel="nofollow noreferrer">Last Light Productions</a> and the former <a href="http://geometrian.com/programming/projects/index.php" rel="nofollow noreferrer">Project Geometrian</a>, Ian Mallet:</p> <blockquote> <p>PyGame is not so good for pixel pushing. Nothing is, other than the GPU. </p> </blockquote> <p>The search then turned out to be a search for <a href="http://en.wikipedia.org/wiki/Alkahest" rel="nofollow noreferrer">Alkahest</a> - something that would turn out never to be truly found - and based on the same idea of rippling images, but this time by using transparency to <em>see through</em> several layers of Pygame surfaces, I posted the question <a href="https://gamedev.stackexchange.com/questions/18923/pygame-circular-cropping-masks">Pygame circular cropping/masks</a> on Gamedev. The <a href="https://gamedev.stackexchange.com/questions/18923/pygame-circular-cropping-masks/18941#18941">chosen answer</a> actually corroborates the fact I already feared that Pygame would never be <em>macho</em> enough for the job.</p> <p>One day later I went back to my previous ideas on development and came across <a href="http://www.ogre3d.org/" rel="nofollow noreferrer">Ogre3D</a>. It turns out that (1) Ogre3D and samples are open-source and (2) one of the examples is a 3-D water model that interacts with a moving object, exactly the same thing I tried to achieve in 2-D, but in a much more professional manner.</p> <p>Since my knowledge in C/C++ is nil, I decided to ask about <a href="https://gamedev.stackexchange.com/questions/18921/ogre3d-customize-water-demo">how to customize the Ogre3D water demo</a> for a glimpse of where to start looking, and one of the answers pointed me to software from Touchscape where an SDK is provided (see <a href="https://gamedev.stackexchange.com/questions/18921/ogre3d-customize-water-demo/18937#18937">this answer</a>).</p> <p>Ogre3D pretty much wrapped it up. Water ripple effect, OpenGL (which it may <a href="http://www.ogre3d.org/tikiwiki/Hardware" rel="nofollow noreferrer">optionally</a> use based on hardware), Game Engine and Python wrappers via <a href="http://www.python-ogre.org/" rel="nofollow noreferrer">Python-Ogre</a> - so my answer to my own question,</p> <blockquote> <p><em>Can anyone provide a suitable implementation of this effect using OpenCV/OpenGL and Pygame?</em></p> </blockquote> <p>is basically</p> <blockquote> <p>Yes. Check Ogre3D's water demo, provided with the SDK - and plug it into Python via <a href="http://www.python-ogre.org/" rel="nofollow noreferrer">Python-Ogre</a>.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload