On Fri, Feb 27, 2009 at 7:52 PM, bforrester <[email protected]>wrote:

>
> I can't seem to get lighting to work right with glDrawElements. I have
> been working on this for quite some time now and can't seem to figure
> out what I'm doing wrong.  After googling, testing, logging, and
> beating my head against the keyboard, I'm hoping someone on this board
> can point out my folly :)
>
> I'm loading a very simple .obj file I exported from blender.  When I
> draw the object in immediate mode it lights/renders perfectly fine.
> Immediate mode is using the same root data (vertices, face indices,
> and calculated normals) as glDrawElements minus the pointers, so I
> know my normal calculations are correct.  When I use glDrawElements
> the geometry is right, but the lighting is very wrong (maybe almost
> random).  It makes me think that the normals pointer isn't right, but
> after double checking the code against examples, I'm pretty sure it's
> right.
>

Any particular reason you aren't just popping the loaded geometry into a
pyglet.graphics.indexed_vertex_list? To my mind it makes things a lot
simpler, and allows you to use pyglet's batching support directly.
-- 
Tristam MacDonald
http://swiftcoder.wordpress.com/

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to