Hi,

Thanks for getting back to me.

So, just to confirm I have this right:

With draw_indexed I can only colour the vertices once, in one hit. In
other words I can use draw_indexed if I want rainbow colours or want
the cube (or whatever 3d shape I am doing) to be just one colour.

If I want faces of different colours I need to define each face
individually so I can set the colour/normals for each face.

If so I thought that might be the case but I wanted to check that I
had not missed anything before I went too far down that road as the
draw_indexed command is so "short and sweet".



On Jul 27, 12:06 am, Tristam MacDonald <[email protected]> wrote:
> 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 MacDonaldhttp://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