This uses a custom library, but the calls to set things like texture
coordinates are pretty obvious:
http://code.google.com/p/skylight1/source/browse/trunk/Skylight1Demos/OpenGL/TankedActivity/src/skylight1/opengl/tanked/TankedGLRenderer.java#162

It is changing the texture coordinates like it does because all the
various rotations are little images in the same texture and it is
deciding which to use:
http://skylight1.googlecode.com/svn/trunk/Skylight1Demos/OpenGL/TankedActivity/res/drawable/tank.PNG

This is a 2D demo, so it rotates by picking different images to use
from a sprite sheet. A 3D version would use a geometry that looked
more like an actual tank and actually rotate it. This uses a pair of
triangles making up a square. Just rotating the square in this
wouldn't look right because each sprite was drawn with a perspective
and built-in lighting coming from a certain direction.

On Apr 14, 11:56 pm, kirti kaul <kirti.k...@wipro.com> wrote:
> Thanks,can you give me an example/Snippet on how to use Atlas Texture
> in openGL ES?
>
> On Apr 13, 4:08 pm, Lance Nanek <lna...@gmail.com> wrote:
>
> > Put all the images needed for texturing all the faces into a single
> > texture. Then refer to coordinates inside the texture to use different
> > parts of it in different places. This is called an atlas texture. I
> > suppose it is also possible to draw the different parts in separate
> > draw calls with a different texture object bound, or to use a second
> > texture unit at the same time.
>
> > On Apr 12, 1:15 am,kirtikaul <kirti.k...@wipro.com> wrote:
>
> > > Hello,
>
> > > Can anybody tell me how to apply apply different textures on different
> > > faces of acylinder?I am able to apply one texture which covers the
> > > wholecylinder.But I want one texture for each face.
>
> > > Thanks in advance!!!- Hide quoted text -
>
> > - Show quoted text -
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to