View Full Version : OpenGL to Quicktime
02-09-2002, 09:45 AM
If I use OpenGL to generate a series of 3D drawings, how can I export them to files that can eventually be used to create Quicktime animations? I don't see any agl call for saving images to common file formats such as PICT, GIF or TIFF.
02-11-2002, 04:41 PM
Use glReadPixels to get a buffer and then a graphics export component to write the file (or simply add it to a movie directly).
Note that glReadPixels is really slow, though there are certain things you can do to speed it up.
03-21-2002, 02:00 PM
I have now worked up the programming to use glReadPixels and then write the image in memory into a TIFF file. This works fine if I run the program (Carbon) under OSX: the TIFF files have proper images when examined with Resourcerer or GraphicConverter, etc. on either OSX or 9.2.
But if I run the program (or a version compiled as a Classic app) under 9.2, the image is garbage. The TIFF header is OK.
Is there a difference between the way glReadPixels works on OSX or 9.2 ?
03-22-2002, 01:07 AM
No, should be the same, whats the code?
03-23-2002, 05:44 PM
here is a code fragment that misbehaves:
outputsize = sizeof(tiffheader)+viewport*viewport*3;
Handle DH = ::NewHandleClear(outputsize);
glReadPixels(0,0,viewport,viewport,GL_RGB, GL_UNSIGNED_BYTE,*DH+sizeof(tiffheader) );
DH is then passed to PowerPlant LFile::WriteDataFork() in DoSave
Using CodeWarrior 7.0, on Mac OS10.1.2 and producing a Carbon application.
This works fine (other than putting the image upside down, which I can fix) when I run the application under OSX and open the image with a Mac OSX application such as Resourcerer. If I run under Mac OS 9 (either Carbon or Classic builds) the image is garbage.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.