Ah thanks, that makes sense, although it would be nice if it were documented(I suppose this is considered obvious to people who actually work with OpenGL :) ). I think the most sensible place to call this would be in my Polygon.draw method.
I have an additional question about how exactly the alpha channel works. Right now I have the color mode set to "c4B", which I think means I provide 4 values(Red, green, blue, alpha), I'm trying to do generate something similar to the partially transparent A over B as seen here: http://upload.wikimedia.org/wikipedia/commons/2/2a/Alpha_compositing.svg . With the end result being something like what's seen at http://alteredqualia.com/visualization/evolve/ . a) Is my understanding of c4B correct, and what value for the alpha compoment makes sense? Thanks for the quick response. On Dec 14, 3:35 pm, "Alex Holkner" <[email protected]> wrote: > On 12/15/08, Alex_Gaynor <[email protected]> wrote: > > > > > I have this code:http://dpaste.com/99080/which is meant to be a > > wrapper around drawing polygons. When I run this code I get the left > > side of screen with the image tinted red, and the right side as just > > red. What I would expect is the left side to just be the image, and > > the right side to be red. I'm not sure what I'm doing incorrectly. > > Any assistance you can provide would be great. > > The current color state is undefined after drawing a polygon > (according to OpenGL) -- in your case you're finding that it's being > set to red, the last vertex color used. pyglet's 'blit' method makes > no assumptions about the current color, and assumes you've set it > yourself correctly. > > Call glColor3f(1, 1, 1) before calling blit to get the image without > tint (white vertices). Alternatively, use a Sprite instead of blit, > which sets its own vertex colors. > > Alex. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
