Looking for parallel function to actionscript's BitmapData.draw() but in OpenGL
I have a flash application that I have been working on for 11 months, and would like to translate it to a different language / platform, preferably Python and OpenGL.
One of the main features in my program is to draw flash vector graphics (or display objects) and then redraw them to a bitmap texture. Is there any way to do this in OpenGL? Basically to draw some polygons on the screen, and then draw these polygons onto a texture. If the texture is displayed dir开发者_如何学Goectly below the polygons , and the polygons are in motion, then there is a dragging/drawing/painting effect.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#draw() --> here is the flash function which I use.
Hopefully someone who is knowledgable in OpenGL & Actionscript would be able to answer this question or provide me with some details. Thankyou!
OpenGL doesn't provide any features for drawing your typical 2D vector graphics. It's a very generic API, but mostly suited for 3D solutions. Implementing the rendering capabilities of Flash in OpenGL is possible, but a lot of work to do yourself.
If you want only a subset (drawing sprites, triangles, convex polygons, lines; alpha blending), then yes, OpenGL may be a good and quick solution.
Otherwise, there's a standard called OpenVG which might be what you want. There are several implementations, some of which may already run on hardware. I haven't tried it so far, though - you'll have to check that one yourself.
精彩评论