Re: [PyOpenGL-Users] generating textures
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@ro...> - 2003-12-22 15:04:16
|
I'm assuming what you are describing is this: * You currently have OpenGL code that renders the map as geometric primitives (lines, triangles & such) * You want to render this geometry into a texture to allow for faster rendering and transformation See the demo OpenGLContext/tests/saveimage.py, which demonstrates the use of glReadPixels to read data back from the OpenGL buffers into an image (which can then be turned into a texture in the same way as you see done in all the "load from image file" demos). It's also possible to generate bitmaps using such things as setting values in Numpy arrays (particularly useful for creating fractals), using PyGame/wxPython to draw into in-memory surfaces/DCs (simple device-context-based drawing systems), or other mechanisms, btw. Images are just data to be manipulated, and the number of ways you can manipulate/create them is pretty large. Hope this helps, Mike Fulko van Westrenen wrote: >Hello, > >I'm rather new to Python and have only basic OpenGL knowledge. I started >building a user interface using both. It works very fine (thanks to all >developers!), but I can't figure out how to make a texture. > >For this display I draw a detailed map, and the drawing takes about 0.5s. >Rotating the map is far to slow. To speed things up I want to turn the >map into a texture, so I can rotate and shift the texture. Loading >textures from an image-file is widely described, but I want/need to generate >the texture using pyOpenGL. Can that be done?, and if so: how? >All tutorials/books say: generate a bitmap. This sounds logical, but I have >no idea how to draw a bitmap using OpenGL, let alone making one using Python. > >Thanks for your help, > >Fulko > > _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |