How does one rotate a scanned image in openGL?

Posts: 321
Joined: 2004.10
Post: #16
Great! I'll add all these techniques to my toolbox. Always good to pick everybody's brains

I don't think I've mentioned it before, but I'm writing a map making utility and I want
the ability to translate, scale, and rotate images. I got the first two with glRaster()
and glScale(), but rotation stumped me. I've learned a hell of alot in the last several

Just in case anybody is interested, I was able to port that "twister" code in the above link
and I just got it to work. Not as elegant from an openGL viewpoint (pun intended) but
very educational nonetheless.

I successfully fed it a 3033x3033 pixel tga image. And it took
about 5 seconds to rotate. A 2048x2048 image took about 2 seconds. Granted this was
the anti-aliased non-weighted algorithm, but still it looked pretty darn good. So not fast
enough for a real time game, but not bad for an old 400 Mhz iMac.

P.S. Graphic converter did not like the 3033x3033 image. Photoshop LE, no problemo.

Thanks again all.
Quote this message in a reply
Posts: 1,234
Joined: 2002.10
Post: #17
Meanwhile, the OpenGL Image sample code I linked to rotates a 3k+ image at 100fps here, with bilinear filtering.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL Image Textures mikey 52 33,128 Jun 30, 2009 10:42 AM
Last Post: AnotherJake
  Cube auto-rotate sakrist 2 3,576 May 5, 2009 03:31 AM
Last Post: Ingemar
  Displaying image with OpenGL and DevIL in C? leRiCl 13 11,425 Jan 23, 2007 01:25 PM
Last Post: djork
  OpenGL Preferred Image Format (BMP, TIFF, ect) Justin Brimm 7 5,877 Apr 18, 2006 03:28 PM
Last Post: arekkusu
  2D Image Generation & openGL LWStrike 2 4,003 Mar 28, 2006 03:34 PM
Last Post: OneSadCookie