2D OpenGL ES Metaballs on android

时光怂恿深爱的人放手 提交于 2019-12-11 02:14:18

问题


I have an array of points (balls) in 2D-space which I want to be displayed as 2D Metaballs.

For learning purposes I implemented it on a canvas by

  1. create an array which represents each pixel
  2. iterate through this array and set a value depending on the distance to every ball for each pixel
  3. iterate again and remove everything below a threshold

That works fine but is extremely slow, as expected. I am pretty new to OpenGL and played around with various samples but I did not manage to make 2D OpenGL Metaballs. Current state is that I have a working representation of my balls by drawing a sprite for each ball (using cocos2d-android-1 if that matters).

Can you provide me some (newbie friendly) steps I need to take?

来源:https://stackoverflow.com/questions/7519251/2d-opengl-es-metaballs-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!