[cello-devel] OpenGL Junkie No-Show On Corman Job! <sigh>

Kenny Tilton ktilton at nyc.rr.com
Sun Mar 7 17:51:16 UTC 2004


Sorry, you won't believe what happened. I couldn't resist testing one 
eentsy-weentsy bit of scrolling before firing up Corman. Twelve hours 
later....

Just so you all know if you get into Cello, OpenGL can be a bear. At one 
point while working on applying textures to arbitrary shapes I noticed a 
gl face culling in some sample code that sounded fast, so I just dropped 
it in to cull back faces. oops. hours later while worrying over 
something else I noticed certain "fill rectangles" were not happening, 
but did not make the connection. indeed, i did not even know enough at 
that point to have made the connection.

but as a debugging step while working on clipping I tried to just fill a 
rectangle so I could be sure of its bounds, at which point I discovered 
that simple code simply was not working. hours later I saw some doc on 
glRect which mentioned that if the second corner given to it was above 
and to the right of the first point, the vertices would be drawn 
counter-clockwise. Stay with me on this. :)

Some hours later I was totally defeated when one of the monkeys randomly 
read aloud the culling code:

      (gl-enable gl_cull_face)
      (gl-cull-face gl_back)

I knew the code was recent (as was the problem filling), and I knew that 
OpenGL decides what direction a polygon is meant to face by the order in 
which the vertices are drawn, clockwise or ccw. clockwise is backfacing. 
bingo. sure enough my fill code was:

     (gl-rectf left top right bottom)

should be

     (gl-rectf left bottom right top)

Aaaaaaaaarrrggghhhhhh!

The good news is that I am creating this higher layer of code so normal 
Cello developers won't have to go toe-to-toe with OpenGL.

Anyway, there is now decent key-controlled scrolling of a texture 
clipped in a smaller pane. But texture dimensions are limited to a power 
of two (don't ask). To scroll an arbitrary JPEG it seems I must master 
move operations using dummy glBitMap calls and glScissor. glClipPlane 
does not work on pixel operations such as glDrawPixels, just polygons.

kenneth


-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film 

Your Project Here! http://alu.cliki.net/Industry%20Application






More information about the cello-devel mailing list