On Sun, Jul 26, 2009 at 7:09 AM, SlowLearner <[email protected]>wrote:

>
> Hi,
>
> I am a newbie to pyglet. I am trying to draw a cube with a different
> colour on each face using opengl.
>
> I have managed to draw a solid red cube with draw_indexed but I can't
> work out how to colour an entire face one colour when applying
> multiple colours.
>
> The colours apply to the vertices rather than to groups of vertices.
> So I end up with a pretty looking cube where the colours all rainbow
> together on the faces.
>
> Is it possible to define colours for faces somehow while using
> draw_indexed or am I going to have to come up with another approach?
>
> Thanks.
>

Rather than treating it as drawing a cube, treat it as drawing 6 squares.
Thus the corner vertices of the cube are duplicated for each face which
contains the corner, each time with the requisite colour.

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