The images need to be loaded into textures (pyglet does this for you),
then you draw them by applying the texture to a geometry. The simplest
thing would be to apply the textures to a quad. Pyglet sprites will do
this for you in 2D. For 3D This can be easily and efficiently done
using a pyglet vertex list. You just need to define one with vertex
coordinates for the four corners of the quad and texture coordinates
to tell OpenGL how to apply the texture. In the simplest case these
tex coordinates are typically ((0,0), (1,0), (1,1), (0,1)) for the
bottom left, bottom right, top right and top left respectively (note
Y=0 is typically at the bottom, unlike other graphics systems you may
be used to).

If you are new to OpenGL, I would highly recommend reading the red
book, which you can find online iirc.

hth,

-Casey

On Wed, Jul 29, 2009 at 4:24 AM, A Y<[email protected]> wrote:
>
> Hi,
>   Thanks a lot. I have the images with their angles in 3D. The main
> part that I have no clue is about loading images. Can I load images in
> the memory and associate them with the appropriate angle and then ask
> the glrotate (or something like that) to do the rest of the job? I can
> then associate the user input to the rotation and it will work fine. I
> just do not know if it is possible to load a lot of images and
> associate them with the correct angle of the surface.
>
>      or I should do it in the way that I usually was doing n the
> other programming languages; getting the input, putting the
> appropriate image on the screen with the correct angle and then
> waiting again for the input...
>
>     Now that I am writing it, it sounds like a general opengl
> question rather than a pyglet. Many thanks for your help.
> A
>
> On Jul 28, 4:06 pm, Tristam MacDonald <[email protected]> wrote:
>> On Tue, Jul 28, 2009 at 12:27 PM, A Y <[email protected]> wrote:
>>
>> > Hi,
>> >   I am a newbie. I have several images from one surface from
>> > different angles and I want to enable the user to rotate a surface and
>> > see it from different angles. The only issue is that I do not want
>> > opengl to automatically calculates the surface, instead to load a new
>> > image each time. Could anyone help me with the direction on how I can
>> > do this? Thanks a lot.
>> > A
>>
>> Roughly speaking, you want to figure out the angle you are viewing the
>> object from, and display the appropriate image.
>>
>> If you are doing this in 3-dimensional space, then you will have to figure
>> out the vector from the viewer to the object, and extract the necessary
>> angle(s) from that.
>>
>> If you can give more details on what you are trying to accomplish (and where
>> you are so far), we may be able to assist further.
>> --
>> 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